Re: aliasing - was:[nice2haveit]

2001-07-19 Thread Me
> Sounds like what we really want is a form of "for" which can iterate > over a list of hashes or arrays: > > for my @a ( @foo, @bar ) { ... > > for my %h ( %foo, %bar ) { ... Yes. Isn't the underlying issue in the above how perl6 handles manipulation and aliasing of multi-dimensional arrays i

Re: aliasing - was:[nice2haveit]

2001-07-19 Thread John Porter
Bart Lateur wrote: > So, in this case, a "with" synonym for "for" would work. > > But this only works for scalars. You can't have a %foo alias to > %Some::Other::hash this way, or a @bar alias to @Some::Other::array. Sounds like what we really want is a form of "for" which can iterate over a lis

RE: aliasing - was:[nice2haveit]

2001-07-19 Thread Sterin, Ilya
Agree. I think that with() should only be used with object references only, and $_ should be set accordingly. Ilya -Original Message- From: John Porter To: [EMAIL PROTECTED] Sent: 07/19/2001 1:01 PM Subject: Re: aliasing - was:[nice2haveit] Sterin, Ilya wrote: > But I thought t

Re: aliasing - was:[nice2haveit]

2001-07-19 Thread John Porter
Sterin, Ilya wrote: > But I thought this was related to more than just with(), so if we have > > ### Would now have to be printed as > > print "This is number "; > print; > print " of 10\n"; > > I still believe that although not defining a variable source will use the > temp variable there is s

RE: aliasing - was:[nice2haveit]

2001-07-19 Thread Sterin, Ilya
cks To: [EMAIL PROTECTED] Sent: 07/19/2001 11:31 AM Subject: Re: aliasing - was:[nice2haveit] > >Then how would you write "I am not a coward" > > with ($foo) > { > print "I am not a"; ##What do I use here or do I have to issue a >#

Re: aliasing - was:[nice2haveit]

2001-07-19 Thread Stuart Rocks
> >Then how would you write "I am not a coward" > > with ($foo) > { > print "I am not a"; ##What do I use here or do I have to issue a >##separate print like... > print; > } > > Ilya Well in Perl5, for the print to use default value it's just 'print;'. The same applie

RE: aliasing - was:[nice2haveit]

2001-07-19 Thread Sterin, Ilya
Stuart Rocks wrote: >> >> C would also make the [variable, alias, whatever] >> default, but not replace the $_: >> >> $_ = "monkey "; >> $foo = "coward"; >> with ($foo){ >> print; >> print "$_"; >> } >> >> would output "monkey coward". >okay, "coward" is default but $_ has not been r

Re: aliasing - was:[nice2haveit]

2001-07-18 Thread Stuart Rocks
> > So, in this case, a "with" synonym for "for" would work. > > > Particularly if '$_' was implied... So with Perl 6's '.' replacing '->', > and 'with' aliasing 'for': > >with ( $XL.{Application}.{ActiveSheet} ) { > .cells(1,1) = "Title"; > .language() = "English"; >} This is m

Re: aliasing - was:[nice2haveit]

2001-07-18 Thread Stuart Rocks
> > So, in this case, a "with" synonym for "for" would work. > > > Particularly if '$_' was implied... So with Perl 6's '.' replacing '->', > and 'with' aliasing 'for': > >with ( $XL.{Application}.{ActiveSheet} ) { > .cells(1,1) = "Title"; > .language() = "English"; >} This is m

Re: aliasing - was:[nice2haveit]

2001-07-18 Thread raptor
>> Does such a thing exist already? > >A WTDI exists already: > >for ( $XL->{Application}->{ActiveSheet} ) { > $_->cells(1,1) = "Title"; > $_->language() = "English"; >} > >(presuming lvalue-methods, of course...) So, in this case, a "with" synonym for "for" would work. ]- OR

Re: aliasing - was:[nice2haveit]

2001-07-18 Thread jh_lists
Bart Lateur wrote: > On Wed, 18 Jul 2001 09:00:25 -0400, John Porter wrote: > >for ( $XL->{Application}->{ActiveSheet} ) { > > $_->cells(1,1) = "Title"; > > $_->language() = "English"; > >} > > > >(presuming lvalue-methods, of course...) > > So, in this case, a "with" s

Re: aliasing - was:[nice2haveit]

2001-07-18 Thread Bart Lateur
On Wed, 18 Jul 2001 09:00:25 -0400, John Porter wrote: >> Does such a thing exist already? > >A WTDI exists already: > >for ( $XL->{Application}->{ActiveSheet} ) { > $_->cells(1,1) = "Title"; > $_->language() = "English"; >} > >(presuming lvalue-methods, of course...) So, in th

Re: aliasing - was:[nice2haveit]

2001-07-18 Thread John Porter
Jeremy Howard wrote: > with $XL->{Application}->{ActiveSheet} { > ->cells(1,1) = "Title" > ->language() = "English" > } > > Does such a thing exist already? A WTDI exists already: for ( $XL->{Application}->{ActiveSheet} ) { $_->cells(1,1) = "Title"; $_->language() =

Re: aliasing - was:[nice2haveit]

2001-07-17 Thread Jeremy Howard
"raptor" <[EMAIL PROTECTED]> wrote: <...> > the idea of aliasing is to preserve the fast access and on the other side to > shorden the "accessor"(i.e the way to access the structure) and make code > clearer.(mostly u can choose a name that has better meaning in your context) > This reminds me... a

Re: aliasing - was:[nice2haveit]

2001-07-17 Thread raptor
> > > I mean something like this : > > > > > instead of : > > > #$Request->{Params} > > > local *myhash = \%{$$Request{Params}}; > > > > > my %myhash alias %{$$Request{Params}};#see - it is my (now as far as I know > > > u can't have it 'my') > > > >You don't need a typeglob there; you can do the