Re: item and slurpy

2005-09-09 Thread Brent 'Dax' Royal-Gordon
On 9/9/05, Juerd <[EMAIL PROTECTED]> wrote: > I am glad "item" is as official as it gets, but I have no personal > favourite between "list" and "slurpy". Please, list members, start a > flame w^W^Wdiscussion about this so that it can be settled. I'll fire the first shot: type names should be nouns

Re: item and slurpy

2005-09-09 Thread Juerd
Larry Wall skribis 2005-09-09 16:45 (-0700): > It's item and list, I think. Pugs uses CxtItem and CxtSlurpy. I am glad "item" is as official as it gets, but I have no personal favourite between "list" and "slurpy". Please, list members, start a flame w^W^Wdiscussion about this so that it can be s

Re: item and slurpy

2005-09-09 Thread Larry Wall
On Sat, Sep 10, 2005 at 12:36:26AM +0200, Juerd wrote: : Are "item context" and "slurpy context" official terms yet? (Note that : "official" is temporary, not permament, and has nothing to do with : things being set in stone.) : : If so, then are the keywords for forcing context also "item" and :

item and slurpy

2005-09-09 Thread Juerd
Are "item context" and "slurpy context" official terms yet? (Note that "official" is temporary, not permament, and has nothing to do with things being set in stone.) If so, then are the keywords for forcing context also "item" and "slurpy", rather than "scalar" and "list"? Juerd -- http://convo

Re: Accessing a list literal by key?

2005-09-09 Thread Larry Wall
On Fri, Sep 09, 2005 at 08:02:32PM +0200, Ingo Blechschmidt wrote: : Hi, : : # Should this work? : say (a => 1, b => 2); # 2 or error? : : # Similarily: : my @array = (a => 1, b => 2); : say @array; : : my $arrayref = [ a => 1, b => 2 ]; : say $arrayref; : : FWIW, I

Accessing a list literal by key?

2005-09-09 Thread Ingo Blechschmidt
Hi, # Should this work? say (a => 1, b => 2); # 2 or error? # Similarily: my @array = (a => 1, b => 2); say @array; my $arrayref = [ a => 1, b => 2 ]; say $arrayref; FWIW, I think accessing arrays and arrayrefs by key should probably not work, but I'm unsure on (...

Re: \(...)?

2005-09-09 Thread Juerd
Larry Wall skribis 2005-09-09 8:58 (-0700): > The decision to copy is made by the =, not by @a. This also copies: > ($a,$b) = ($b,$a) > This is how Perl 5 assignment works, and we're trying not to break that... This is all true. However, back to the scalar case, assuming the comma/alias thi

Re: \(...)?

2005-09-09 Thread Larry Wall
On Fri, Sep 09, 2005 at 04:58:37PM +0200, Ingo Blechschmidt wrote: : Hi, : : Juerd wrote: : > Infix? Infix operators are binary, comma is not. That infix operators are always binary is just a cultural assumption based on the historical restriction to right-associative and left-associative operato

Re: \(...)?

2005-09-09 Thread Larry Wall
On Fri, Sep 09, 2005 at 05:35:42PM +0200, Ingo Blechschmidt wrote: : my @a = (1,2,3); # @a's STORE method recognized that the RHS : # is an aggregate, so it created new containers. The decision to copy is made by the =, not by @a. This also copies: ($a,$b) = ($b,$a

Re: Packages, Modules and Classes

2005-09-09 Thread Larry Wall
On Fri, Sep 09, 2005 at 08:46:06AM -0700, Larry Wall wrote: : If these are really postfix operators, then we can also write : : Foo .::{} : Foo .::<> : Foo .::() But I don't think they can really be postfix. At least, ::() isn't, since $Foo .::($bar) would not be the same as we

Re: Packages, Modules and Classes

2005-09-09 Thread Larry Wall
On Thu, Sep 08, 2005 at 07:41:52PM -0400, Stevan Little wrote: : So it would be Foo::.keys() then? : : Would this be possible? The more I think about it, the more I'm leaning toword postfix operators ::{} and ::<>, essentially in same syntactic niche as ::(). Which means you'd have to write that

Re: \(...)?

2005-09-09 Thread Ingo Blechschmidt
Hi, Larry Wall wrote: > On Fri, Sep 09, 2005 at 04:40:11PM +0200, Juerd wrote: > : Ingo Blechschmidt skribis 2005-09-09 15:12 (+0200): > : > I agree that the comma operator creates an anonymous array, but I > : > do not agree that it behaves as if it has [] around it. > : > > : > Creating an anon

Re: \(...)?

2005-09-09 Thread Ingo Blechschmidt
Hi, Juerd wrote: > Ingo Blechschmidt skribis 2005-09-09 15:12 (+0200): >> I agree that the comma operator creates an anonymous array, but I do >> not agree that it behaves as if it has [] around it. >> >> Creating an anonymous array does not require creating new containers >> -- > > So comma in

Re: \(...)?

2005-09-09 Thread Larry Wall
On Fri, Sep 09, 2005 at 04:40:11PM +0200, Juerd wrote: : Ingo Blechschmidt skribis 2005-09-09 15:12 (+0200): : > I agree that the comma operator creates an anonymous array, but I do not : > agree that it behaves as if it has [] around it. : > : > Creating an anonymous array does not require creati

Re: \(...)?

2005-09-09 Thread Juerd
Ingo Blechschmidt skribis 2005-09-09 15:12 (+0200): > I agree that the comma operator creates an anonymous array, but I do not > agree that it behaves as if it has [] around it. > > Creating an anonymous array does not require creating new containers -- So comma in scalar context creates an array

Re: \(...)?

2005-09-09 Thread Ingo Blechschmidt
Hi, Juerd wrote: > Ingo Blechschmidt skribis 2005-09-09 11:59 (+): >> > > > \(@array,) is [ @array ], NOT map { \$_ } @array >> > > I'm not sure of the []s, remember &postcirumfix:<[ ]> creates >> > > *new* containers: >> > That was the point. >> > > [EMAIL PROTECTED] = $bar; >> > > (@

Re: Parsing indent-sensitive languages

2005-09-09 Thread Peri Hankey
Many apologies for triple posting - short-circuit between ears. Peri Hankey -- http://languagemachine.sourceforge.net - The language machine

Re: \(...)?

2005-09-09 Thread Juerd
Ingo Blechschmidt skribis 2005-09-09 11:59 (+): > > > > \(@array,) is [ @array ], NOT map { \$_ } @array > > > I'm not sure of the []s, remember &postcirumfix:<[ ]> creates *new* > > > containers: > > That was the point. > > > [EMAIL PROTECTED] = $bar; > > > (@array,)[0] = $bar; >

Re: Parsing indent-sensitive languages

2005-09-09 Thread Peri Hankey
Dave Whipp wrote: If I want to parse a language that is sensitive to whitespace indentation (e.g. Python, Haskell), how do I do it using P6 rules/grammars? The way I'd usually handle it is to have a lexer that examines leading whitespace and converts it into "indent" and "unindent" tokens. The

Re: \(...)?

2005-09-09 Thread Ingo Blechschmidt
Hi, Juerd convolution.nl> writes: > Ingo Blechschmidt skribis 2005-09-06 21:24 (+0200): > > > \(@array,) is [ @array ], NOT map { \$_ } @array > > I'm not sure of the []s, remember &postcirumfix:<[ ]> creates *new* > > containers: > > That was the point. > > > [EMAIL PROTECTED] =

Re: Parsing indent-sensitive languages

2005-09-09 Thread Peri Hankey
Dave Whipp wrote: If I want to parse a language that is sensitive to whitespace indentation (e.g. Python, Haskell), how do I do it using P6 rules/grammars? The way I'd usually handle it is to have a lexer that examines leading whitespace and converts it into "indent" and "unindent" tokens. T

Re: Parsing indent-sensitive languages

2005-09-09 Thread Peri Hankey
Dave Whipp wrote: If I want to parse a language that is sensitive to whitespace indentation (e.g. Python, Haskell), how do I do it using P6 rules/grammars? The way I'd usually handle it is to have a lexer that examines leading whitespace and converts it into "indent" and "unindent" tokens. The