Re: Apoc2 - Context and variables

2001-05-08 Thread David L. Nicol
Jonathan Scott Duff wrote: > (*%a, %b) = (%c,%d);# %a slurps, %b gets nothing > (%a, *%b) = (%c,%d);# %a = %c, %b gets the rest > > I'm sure your imaginations can twiddle the cardinality knob > appropriate for generalization :-) > > -Scott so if you don't know exactly

Re: Apoc2 - Context and variables

2001-05-08 Thread Nathan Wiger
* Larry Wall <[EMAIL PROTECTED]> [05/08/2001 10:11]: > > Nathan Wiger writes: > : First off, before I forget to mention it, nice job on Apoc2 Larry! You are > : the man. I know alot of us on p6l can seem like harsh critics at times, but > : it's only because we love Perl so much. ;-) > > We'll ha

Re: Apoc2 - Context and variables

2001-05-08 Thread David L. Nicol
I like the lisp-associative-array alternating keys,values nature of the perl5 %hash=@array semantics, and the way it can be used to set defaults in hashref argument lists. The replacement must provide an equivalent but less hacky replacement. -- David Nicol 816.235.11

Re: Apoc2 - Context and variables

2001-05-08 Thread Larry Wall
Nathan Wiger writes: : First off, before I forget to mention it, nice job on Apoc2 Larry! You are : the man. I know alot of us on p6l can seem like harsh critics at times, but : it's only because we love Perl so much. ;-) We'll have to do something about that. :-) : Anyways, in addition to the

Re: Apoc2 - Context and variables

2001-05-07 Thread Simon Cozens
On Mon, May 07, 2001 at 05:35:53PM -0400, John Porter wrote: > Yep... particularly considering something neat like > keys(%a) = @b; See my earlier comments on lvalue operators. I *hope* lvalues will be a lot more flexible in Perl 6. :) -- Be not anxious about what you have, but about what

Re: Apoc2 - Context and variables

2001-05-07 Thread John Porter
Graham Barr wrote: > And what is wrong with > @a{@b} = (); > which I use all the time. I use it too, because that's the perl5 idiom. But what's "wrong" with it is that you don't have a set on the LHS, you have some funky hash slice thing, with both the hash AND the keys being assigned into it

Re: Apoc2 - Context and variables

2001-05-07 Thread Graham Barr
On Mon, May 07, 2001 at 05:35:53PM -0400, John Porter wrote: > Edward Peschko wrote: > > If > > %a = @b; > > does > > %c = map{ ($_ => undef ) } @a; > > Yep... particularly considering something neat like > > keys(%a) = @b; And what is wrong with @a{@b} = (); which I use all th

Re: Apoc2 - Context and variables

2001-05-07 Thread John Porter
Edward Peschko wrote: > If > %a = @b; > does > %c = map{ ($_ => undef ) } @a; Yep... particularly considering something neat like keys(%a) = @b; could be defined to do that. Or, even niftier @%a = @b; -- John Porter

Re: Apoc2 - Context and variables

2001-05-07 Thread Jonathan Scott Duff
On Fri, May 04, 2001 at 09:06:47PM -0700, Nathan Wiger wrote: >%a = (%b : %c);# flattened like Perl 5 Why not this? *%a = (%b, %c); # flattened. splat! This makes sense to me since * is already proposed as the slurping operator and since the LHS is providing context

Re: Apoc2 - Context and variables

2001-05-04 Thread Edward Peschko
> Maybe we need a new flattening operator. I don't think the proposed := by > itself would do everything we need to do. Maybe we need a way to say > "flatten these together". I'm going to throw out a new ":" op here: > >%a = (%b, %c); # same as %a = %b >%a = (%b : %c);# fl

Re: Apoc2 - Context and variables

2001-05-04 Thread John Siracusa
On 5/5/01 12:06 AM, Nathan Wiger wrote: > Maybe we need a way to say "flatten these together". > I'm going to throw out a new ":" op here: [snip] > Hmmm... I kinda like that... Am I missing anything? Maybe the fact that Larry's already claimed the colon? :) -John

Re: Apoc2 - Context and variables

2001-05-04 Thread Nathan Wiger
> Horrors is right. The default perl5 behaviour is *useful*. I use the %b=(%a,%c) > metaphor all of the time. > > Why not just keep it simple? And perl5-ish. Two contexts, scalar and list, > hashes NOT a context of its own. I agree. But what to do with: (%a, %b) = (%c, %d); Surely that shoul

Re: Apoc2 - Context and variables

2001-05-04 Thread John Siracusa
On 5/4/01 11:47 PM, Edward Peschko wrote: > Horrors is right. The default perl5 behaviour is *useful*. I use the > %b=(%a,%c) > metaphor all of the time. I believe you can get the Perl 5 functionality by throwing a few * characters in there somewhere... > Why not just keep it simple? Based on A

Re: Apoc2 - Context and variables

2001-05-04 Thread Edward Peschko
On Fri, May 04, 2001 at 11:23:12PM -0400, John Siracusa wrote: > On 5/4/01 11:09 PM, Nathan Wiger wrote: > > The real trick is what to do with these: > > Note: stabbing wildly here... :) > > > %a = (%b, %c); > > %a = (stringify(\%b) => \%c); # Perl 5-ish > %a = (%b.str => %c);

Re: Apoc2 - Context and variables

2001-05-04 Thread John Siracusa
On 5/4/01 11:09 PM, Nathan Wiger wrote: > The real trick is what to do with these: Note: stabbing wildly here... :) > %a = (%b, %c); %a = (stringify(\%b) => \%c); # Perl 5-ish %a = (%b.str => %c); # Perl 6 equiv. > %d = (@e, @f); %d = (stringify(\@e) => \@f); # Perl 5-ish

Re: Apoc2 - Context and variables

2001-05-04 Thread Nathan Wiger
>>$a = @b; >> >>2. Pull a reference to @b (like Perl5's "$a = \@b") > > Yep. Scalar context eval of arrays, hashes, and subs produces a reference. Perfect. >> Similarly, how about: >> >>%c = @d; >> >> Does this: >> >>1. Create a hash w/ alt

Re: Apoc2 - Context and variables

2001-05-04 Thread Damian Conway
> I'm interested in what happens with interactions: > >$a = @b; > > Does this: > >1. Get the length (doesn't seem to make sense now) No. length(@b) or @b.length() for that. >2. Pull a reference to @b (like Perl5's "$a = \@b") Yep. Scalar context eval of a

Apoc2 - Context and variables

2001-05-04 Thread Nathan Wiger
First off, before I forget to mention it, nice job on Apoc2 Larry! You are the man. I know alot of us on p6l can seem like harsh critics at times, but it's only because we love Perl so much. ;-) Anyways, in addition to the $file.next stuff, I'm curious about a few clarifications on the new semant