Re: S09 editorial fixes

2008-04-02 Thread Audrey Tang
John M. Dlugosz 提到: = on Parallelized parameters and autothreading use autoindex; do { @c[$^i, $^j, $^k, $^l] = @a[$^i, $^j] * @b[$^k, $^l] }; Shouldn't those be semicolons? Ditto for subsequent examples. Also, what does the do do? I think it is only meaningful if there was

Re: S09 editorial fixes

2008-04-02 Thread Audrey Tang
Audrey Tang 提到: John M. Dlugosz 提到: = on Parallelized parameters and autothreading use autoindex; do { @c[$^i, $^j, $^k, $^l] = @a[$^i, $^j] * @b[$^k, $^l] }; Shouldn't those be semicolons? Ditto for subsequent examples. Also, what does the do do? I think it is only meaningful

Re: S09 editorial fixes

2008-04-02 Thread Larry Wall
On Wed, Apr 02, 2008 at 11:02:37PM +0800, Audrey Tang wrote: : Sanity-check before I check it in? I'm probably not the best person to ask about *sanity*, but it looks pretty darn good to me. :) Larry

Re: S09 editorial fixes

2008-04-02 Thread Audrey Tang
John M. Dlugosz 提到: But about your answer, automatically called with no arguments. Isn't that what a bare closure normally does anyway? Say, I introduced extra {} just for scoping or naming the block, where a statement is expected. foo; bar; { my $temp= foo; bar(temp); } #forget about

Re: S09 editorial fixes

2008-04-02 Thread Audrey Tang
John M. Dlugosz 提到: I just finished another pass on S09v24, and in this posting I note editorial issues with the file that can easily be corrected. This is as opposed to subjects for deep discussion, which I'll save for later and individual posts. = on Mixing subscripts Within a C.[]

Re: S09 editorial fixes

2008-04-02 Thread Larry Wall
On Thu, Apr 03, 2008 at 12:04:47AM +0800, Audrey Tang wrote: : I guess the wording in the last parenthesized parens is insufficiently : explicit, and maybe we should change it to say that it's really a syntax : error to use placeholder blocks in statement positions. Sounds reasonable? Yes,

Re: S09 editorial fixes

2008-04-02 Thread Audrey Tang
Larry Wall 提到: Yes, unless we decide we need something like that for list comprehensions. Maybe looping modifiers allow placeholders in what would otherwise be an error... Sure. How about this: Use of a placeholder parameter in statement-level blocks triggers a syntax error, because the

Re: S09 editorial fixes

2008-04-02 Thread Larry Wall
On Thu, Apr 03, 2008 at 12:43:58AM +0800, Audrey Tang wrote: Larry Wall 提到: Yes, unless we decide we need something like that for list comprehensions. Maybe looping modifiers allow placeholders in what would otherwise be an error... Sure. How about this: Use of a placeholder parameter

Re: S09 editorial fixes

2008-04-02 Thread Audrey Tang
Larry Wall 提到: I was originally thinking just loop modifiers, but I suppose { say $^x } if foo(); also can be made to make some kind of sense, in the same way that if foo() - $x { say $x } is supposed to work. Right. I've committed the clarification (as a new section).

Re: S09 editorial fixes

2008-04-02 Thread Nicholas Clark
On Wed, Apr 02, 2008 at 10:03:57AM -0700, Larry Wall wrote: Yes, current STD has the inside of () and [] as statementlist, which throws away all but the last statement. Arguably [] at least should probably be semilist though, and maybe () too. my @x := [{1+1}; {2+2}]; @x is currently

Re: S09 editorial fixes

2008-04-02 Thread Audrey Tang
Nicholas Clark 提到: So if the semicolon is replaced with a comma, like this, my @x := [{1+1}, {2+2}]; the {} acts as a hash constructor, and @x is [{2 = undef}, {4 = undef}] ? No, {} acts as a closure constructor, and @x contains two closures that returns 2 and 4 respectively when

Re: S09 editorial fixes

2008-04-02 Thread Audrey Tang
Thom Boyer 提到: Audrey Tang wrote: $code = { a = 1, $b, $c == print }; The examples above are from LS04/Statement parsing. According to those rules, that last assignment to $code seems to be a hash, not code. Or does the C == mean that the contents aren't a list? Correct, because ==

Re: S09 editorial fixes

2008-04-02 Thread John M. Dlugosz
Regarding the text just before where you rewrote, then the compiler adds defaults for you, something like: - $x = @foo.shape[0].range, $y = @foo.shape[1].range { @foo[$x;$y] } where each such range is autoiterated for you. That doesn't really work. If

Re: S09 editorial fixes

2008-04-02 Thread John M. Dlugosz
Audrey Tang audreyt-at-audreyt.org |Perl 6| wrote: I guess the wording in the last parenthesized parens is insufficiently explicit, and maybe we should change it to say that it's really a syntax error to use placeholder blocks in statement positions. Sounds reasonable? Cheers, Audrey