Re: adverbial form of Pairs notation question

2008-09-09 Thread TSa
HaloO, Jon Lang wrote: Actually, note that both infix:<,> and circumfix:<[ ]> can be used to build lists; so [1] and [] can be used to construct single-element and empty lists, respectively. I doubt that. Actually, circumfix:<[ ]> builds arrays. And note that there's no infix operator that con

Re: adverbial form of Pairs notation question

2008-09-08 Thread Mark J. Reed
On Mon, Sep 8, 2008 at 1:29 PM, Jon Lang <[EMAIL PROTECTED]> wrote: > TSa wrote: >> Ahh, I see. Thanks for the hint. It's actually comma that builds lists. >> So we could go with () for undef and require (1,) and (,) for the single >> element and empty list respectively. But then +(1,2,3,()) == 4.

Re: adverbial form of Pairs notation question

2008-09-08 Thread Jon Lang
TSa wrote: > Ahh, I see. Thanks for the hint. It's actually comma that builds lists. > So we could go with () for undef and require (1,) and (,) for the single > element and empty list respectively. But then +(1,2,3,()) == 4. Actually, note that both infix:<,> and circumfix:<[ ]> can be used to bu

Re: adverbial form of Pairs notation question

2008-09-08 Thread TSa
HaloO, Mark J. Reed wrote: On Mon, Sep 8, 2008 at 11:08 AM, TSa <[EMAIL PROTECTED]> wrote: Sorry, what am I missing that I see no problem with List always itemizing to an Array? A List *does* always itemize to an Array. But parens do not a List make; the discontinuity mentioned is syntactic.

Re: adverbial form of Pairs notation question

2008-09-08 Thread TSa
HaloO, Damian Conway wrote: At YAPC::EU I pointed out to Larry that we have an adverbial form that defaults to true: :foo For orthogonality and clarity purposes this could also be written :?foo and one that defaults to false: :!foo but none that defaults to undef. After reje

Re: adverbial form of Pairs notation question

2008-09-08 Thread Mark J. Reed
On Mon, Sep 8, 2008 at 11:08 AM, TSa <[EMAIL PROTECTED]> wrote: > Sorry, what am I missing that I see no problem with List > always itemizing to an Array? A List *does* always itemize to an Array. But parens do not a List make; the discontinuity mentioned is syntactic. (1,2,3) # (or longer) Lis

Re: adverbial form of Pairs notation question

2008-09-08 Thread TSa
HaloO, Larry Wall wrote: > As mentioned on irc, it should do the same thing as "foo" => (). > The question is whether () in item context promotes to []. I don't > think it ought to, since () is really the only way we have of writing > NIL in Perl 6, and [] isn't really NIL. And I think it would

Re: adverbial form of Pairs notation question

2008-09-08 Thread TSa
HaloO, Brandon S. Allbery KF8NH wrote: On 2008 Sep 6, at 13:57, Larry Wall wrote: But basically I think NIL is a mild form of failure anyway, so it's fine with me if () is a form of failure that is smart enough to be I'm thinking () is the non-scalar (list, array, capture, maybe hash) versio

Re: adverbial form of Pairs notation question

2008-09-08 Thread Damian Conway
On Sat, Sep 06, 2008 at 07:06:30PM +1100, Илья wrote: : Hello there, : what :foo<> should exactly produce? : At first I was expecting: : foo => "" : but in Rakudo: : foo => [] : and it looks like the right thing on the other hand. At YAPC::EU I pointed out to Larry that we have an adverbial form

Re: adverbial form of Pairs notation question

2008-09-06 Thread Brandon S. Allbery KF8NH
On 2008 Sep 6, at 13:57, Larry Wall wrote: But basically I think NIL is a mild form of failure anyway, so it's fine with me if () is a form of failure that is smart enough to be I'm thinking () is the non-scalar (list, array, capture, maybe hash) version of undef, which acts like a value unle

Re: adverbial form of Pairs notation question

2008-09-06 Thread Larry Wall
On Sat, Sep 06, 2008 at 07:06:30PM +1100, Илья wrote: : Hello there, : what :foo<> should exactly produce? : At first I was expecting: : foo => "" : but in Rakudo: : foo => [] : and it looks like the right thing on the other hand. : : (I have started this topic in the November mail list : http://