irclog.perlgeek.de/perl6book/today | source: github.com/perl6/book/
Set by moderator on 25 May 2010.
dalek ok: 07fd0ad | chromatic++ | src/subs-n-sigs.pod:
Edited chapter, leaving a couple of author notes.
00:46
ok: b3a2e1c | util++ | src/roles.pod:
Fixed two bad POD keywords for programlisting sections - s/=being/=begin/
03:48
ok: 190bf45 | util++ | src/subs-n-sigs.pod:
Fixed missing closing brace in code example
03:54
ok: 288b3d2 | util++ | src/subs-n-sigs.pod:
Changed approximation of "e" to exact value in code example
04:06
ok: 9eacc6b | util++ | README:
Fixed typo in distro name - s/Ununtu/Ubuntu/
05:07
ok: c88e280 | util++ | src/subs-n-sigs.pod:
Fixed missing ";" in code example
05:09 eternaleye joined 14:23 Util joined
dalek ok: 001c38c | util++ | src/multi-dispatch.pod:
[mmd] Fixed syntax by adding "multi" to example
14:26
15:09 shamu joined
shamu anyone out there? 15:15
had a question about the intended audience for the book; irclog.perlgeek.de/perl6book/2009-10-07 answers much of my questions, and brings up a couple others 15:16
someone mentioned junior programmer; should it be someone who already knows perl, already knows another dynamic language, already knows c? 15:18
moritz_ already knows a programming language 15:27
dynamic language is helpful, but not a must
(oh, we should mentioni garbage collection at some point)
shamu It also says its supposed to be example-based; is that still the case, so it's a tutorial by examples, or will it attempt to fill in/refresh understanding of the programming concepts it reimplements? 15:37
hold on, I'll find an example
'scores' is a string literal. A string is a piece of text, a sequence of characters. In this line, it's the 15:39
argument provided to open. If you prefer C-style notation, you can write instead open('scores').
my @names = $file.get.split(' ');
and before that: 15:40
A variable name begins with a sigil, which is a non-word character such as $, @, %, or &or occasionally
the double colon ::. The sigils usually restrict the variable to some particular type. After the sigil
argh, sorry -- start at 'a variable name begins with a sigil', then read all that, then: 15:41
The built-in function open opens a file, here named scores, and returns an object representing that
file, a file handle. The equality sign = assigns that file handle to the variable on the left, which
means that $file now stores the file handle.
there's no indication there that $ indicates a scalar -- or further on, since it says that you can store anything there (even arrays), what it does indicate 15:42
so my guess is that you want more verbiage in there describing that the $ indicates a scalar, that a scalar holds one value, and maybe that that was historically true in perl but has been extended beyond that 15:44
15:46 p6eval joined
shamu an existing perl5 programmer will find this familiar, but I'm wondering what the targeted level of the book is to indicate how much to fill in -- perhaps to draw analogies to other languages (such as a string in python or varchar in visual basic) 15:46
or to explain 'scalar' from the basics (its a variable, and is intended to contain an integer or string, etc) 15:47
I'm asking because I wanted to print out a copy of the book and add some edits and maybe some patches, so I wanted to know if edits are useful and/or what level to target any new content at
and also whether to follow a tutorial style which focuses on the language syntax, or something that centers around detailed examples including design choices, or more referencey (from the log, it seemed we dont want the latter, but I'm guessing one is needed) 15:51
oh, and who are the big active contributors to the book currently? 15:54
dang, drove him away 15:56
Util is here; backscrolling... 15:59
shamu: re: big active contributors 16:07
Title page reads: Jonathan S. Duff, Moritz Lenz, Carl Mļæ½sak, Patrick R. Michaud, Jonathan Worthington
Running `git log --pretty=format:'%an' | sort | uniq -c | sort -nr` shows lots of (content) commits by: Moritz Lenz, Carl Masak, Jonathan Scott Duff, Jonathan Worthington
Original commit by: pmichaud 16:08
Lots of edits by: Matt Kraai, chromatic, Bruce Gray (Util)
moritz_ re
Util Others contributors, I have not checked; might have contributed a major section?
moritz_ Util: the author's list is still very preliminary
shamu: sorry, been away for a while... 16:10
shamu: yes, scalar and $ needs more explanation
Util moritz_: Good; I hope to be added to it! I wrote an extensive outline for the subs chapter months ago, then my git-fu was weak, and it was invisible to the other authors :(
moritz_ however I don't know how to phrase it well. Saying that a scalar can hold one value is quite misleading in Perl 6
shamu np 16:11
oh right, I can check that
moritz_ especially since we don't follow the "a [ ... ] is a reference pointing to an array" meme anymore
and yes, we still try to follow the Example - Explanation - Extension pattern 16:12
16:12 p6eval joined
shamu *exactly* -- that's a subtlety that's introduced in perl5 (sigil $ indicates one, whether from scalar or single array elt) to perl6 ( sigil sticks with the variable, so now even $ can be a deep data structure and indexed directly via [] or {}) 16:13
and both of those subtleties are lost on someone coming from a bare language (pretty much anything but php or basic)
16:14 p6eval joined
moritz_ the real difference between $ and @ in Perl 6 is that in list context, $ variables produce one value 16:14
shamu in the example - explanation - extension context, then, I'd think one would want to:
Saying that a scalar can hold one value is quite misleading in Perl 6
lie about that to further the central purpose of the example, with a footnote saying 'its not really so, but think about it this way for now' 16:15
moritz_ good place for a footnote!
shamu yes -- exactly -- I saw that trying to make it an accurate tutorial describing the language features as they are (textbook, class-like) vs example (goal-directed) comes up with these kinds of conflicts, and I wanted to know which way to go, and you're saying it's go for the purpose of the example, right? 16:16
Util My wife was a phrase for "its not really so, but good enough depiction for now" from AIDS lecturing: "This is the `cartoon` version of..." 16:17
s/was/has/
moritz_ oh, src/subs-n-sigs.pod has ":A scalar (the C<$> sigil) implies no constraints. Anything may bind to it, ..." 16:18
shamu gotcha.
moritz_ but it should be in chapter one in some form 16:19
shamu how about saying a scalar is a scalar in the example, but referring forward to that: 'footnote: not really true, cf <sub section>'
moritz_ The C<$> sigil indicates a I<scalar> variable, which indicates 16:23
that the variable stores a single value N<However, this single value
can still be a compound object like an array or a hash. When you iterate over
a C<$>-sigiled variable, it is interpreted as a single value, even it does
store an array>.
is that sufficiently non-confusing? 16:24
shamu it's sufficiently precise from a description of the implementation; but this is a perfect case of me wanting to know, relative to the context of the book, how much 'why' to put in. I think there are historical and other design decisions about why you have a $ as a visual indicator of scalar, yet allow it to semantically mean an array 16:26
moritz_ shamu: I think "why" is good, as long as it's not focused on "why, in contrast to Perl 5"
because we don't assume perl 5 knowledge
that's what perlgeek.de/en/article/5-to-6 is about (and might be a different book at some point) 16:27
shamu ah ok
ok, so 'why' is good as long as one can describe it in the context of perl 6 design decisions. 16:28
moritz_ right
Util thoughts on refinement of that particular text: 16:29
The C<$> sigil indicates a I<scalar> variable, which indicates that the variable stores a single value
N<However, this value can be a sort of I<reference> to a multi-value object (such as an array). More on such references in chapter XXX.>
moritz_ Util: that's perl 5 think
Util: and doesn't make much sense, when dereferncing is implicit
shamu great -- how do you explain the 'why', from the perspective of a junior programmer, solely in perl 6 design decisions that a coder can burn into their brain in a way that makes sense, why you have a visual indicator for something called a scalar, which also can mean multiple things -- maybe an analogy to visual basic's 'variant' type? 16:31
I'm not trying to bash on you, just want a guideline for how much detail to go into for this kind of stuff, and how much you'd feel its ok for me to gloss over/punt, when describing a worked example 16:32
if I contribute stuff, which I'd like to
Util moritz_: I must have missed the meeting where the thinking changed from "implicit dereferencing is a convenience to the programmer" to "scalars really *are* compound objects sometimes". If you (or anyone) could provide a pointer to such a discussion, it would help me not try to contribute text based on older Perl6 concepts. TIA
moritz_ shamu: I think it doesn't make sense to explain the "why" of $ and @ in-depth so early in the book... 16:34
shamu also, is it cool to cross-reference other documentation, and if so, what other ones can we refer to?
good, so err on glossing over in favor of the example 16:35
moritz_ shamu: in the first chapter I'd just say something along the lines of "while you can store arrays in scalar variables, it really makes more sense to use the @ sigil, becuase it gives you some kind of type safety" 16:36
shamu in that context, I'd just say that it stores one value such as a string, filehandle, or number, and punt the entire rest to point to a data types reference/tutorial section
should I even bother mentioning this, if the example doesn't do that?
moritz_ Util: I'll try to find such a discussion, but I'm afraid most of these are not coherent for the casual reader, or even understandable :(
shamu: that might be better than my approach 16:38
shamu I'd much rather footnote 'advanced/other/special uses of scalar variable can store other items; cf <some reference>' and leave at at that for the purpose of getting through the example
oh ok
Well, if you're disposed to not dogmatically reject changes like that, I'm willing to try to contribute and reshape prose that has some chance of being accepted 16:39
I've wanted to contribute for a while, but other factors made it difficult. Now I'll give it a shot.
thanks for responding! 16:40
Util moritz_: thanks! I am actually not a casual reader; I just look that way online :)
shamu oh and I'd like to meet some of the authors at yapc; know who's going?
moritz_ shamu: I try hard not to reject stuff... even if some patch goes against the idea of the book, it usually points to some deficit that needs tackling
no idea 16:41
Util will see shamu at YAPC again.
moritz_ \\o/ 16:42
shamu considers this eeeexcellent
ah, that's key; thank you very much for that elaboration 16:43
moritz_ I'm afraid my budget is too limited this year, for both YAPC::NA and ::EU
shamu where are you located?
moritz_ shamu: do you have a github ID?
germany
car broke down; need to buy a (mostly) new one
shamu: I've pushed the first version about scalars; feel free to improve 16:44
shamu 'krishnoid'
moritz_ hugme: add krishnoid to book
hugme hugs krishnoid. Welcome to book!
moritz_ there you go
dalek ok: 38d3aa9 | moritz++ | src/basics.pod:
[basics] talk more about scalars

Also remove a notice from chromatic++ which we follow now; Add a footnote for the Perl 5 programmer about sigil invariance
16:45
shamu wow, ok. Not sure how much I can commit to ahead of time, but with that last note about why you don't try to reject stuff, I will try to contribute
and ... off to breakfast 16:46
moritz_ Util: irclog.perlgeek.de/search.pl?channe...=reference shows that the official stance is "everything is a reference", so it doesn't really make sense to say that my $a = [1, 2, 3] stores a reference, while @a = (1, 2, 3); does not 16:48
(which I mess up from time to time)
and maybe interesting in this respect is that whether things interpolate (both in strings and in list/slice context) is a syntactic question, not of references 16:51
but I have a hard time finding a discussion about it
Util moritz_: thanks! I need to give some thought as to where "references" would fit in a pure-Perl6-from-scratch training class, since they still have an important conceptual place once you get to multi-level data structures (and probably before that place, somewhere) 16:53
moritz_ Util: that's right...
Util: it's weird that you basically need to understand references, but we try not to talk about them explicitly
shamu breakfast was delayed briefly 16:54
moritz_ one reason for avoiding the discussion is that it's a rather complicated topic in Perl 6
shamu my 2c is that a description of references has to exist, but where to put it maybe can be decided later -- possibly to fit in a basic whys-of-design or underlying technology discussion 16:55
moritz_ and it's hard to for me to give a "close enough" description without fully grokking them
we should have more of those discussions
maybe with some special markup
indicating "if you're already confused, skip this section on first reading" 16:56
:-)
shamu ah -- one suggestion is to try to tell it more narratively rather than factually
it might help with the understanding for some, then others have actual english phrases they can hang concepts on and get them fleshed out through more extensive reference material, once it becomes available 16:57
Util shamu: I see pmichaud and chromatic are attending YAPC, but no other perl6book people are pre-registered.
shamu thanks for checking; I look forward to seeing you and the others 16:58
moritz_ shamu: picking up your previous question about linking to other docs... providing links to synopsis and other pages that have proofed to be long living
... is certainly a good idea
shamu ok cool
Thank you very much for the info. 17:00
moritz_ thank you for the discussion
Util taking details that are just "clutter" at one stage of learning, and explicitly *deferring* their discussion until later, is a useful technique. By using a footnote to say "this is not the full story", you reduce confusion in those who already know something about the deferred detail, and subtly whet the appetite of the beginner, without coming across as a liar later. 17:02
s/liar/disorganized author/
moritz_ (problem is: we are disorganized authors) 17:03
dalek ok: ef42d30 | moritz++ | src/subs-n-sigs.pod:
[subs] incorporate some cleanup by chromatic++
Util moritz_: too true. A coherent voice is important, but printed (and accurate) knowledge-on-paper is even more imporatant at this stage in the Rakudo game (Rakudo Star release / major conference time). 17:07
17:36 cognominal joined 20:45 eternaleye joined