Re: "<->" as "->" with automatic "is rw"

2004-08-21 Thread Jonadab the Unsightly One
Juerd <[EMAIL PROTECTED]> writes: > Sick would be if <- were introduced to make the variable write-only ;) Sicker still would be if - were introduced to make the variable neither readable nor writeable. HTH.HAND. -- $;=sub{$/};@;=map{my($a,$b)=($_,$;);$;=sub{$a.$b->()}} split//,"[EMAIL PROTECT

Re: "<->" as "->" with automatic "is rw"

2004-08-21 Thread Juerd
Larry Wall skribis 2004-08-20 13:31 (-0700): > Unfortunately I'm not sure it passes the "Are there already too many > ways to declare a sub?" test... I'm not seeing it as another way. Technically, of course it is different, but by the user, <-> and -> will probably be seen as one thing, with one o

Re: "<->" as "->" with automatic "is rw"

2004-08-21 Thread Adam D. Lopresto
On Fri, 20 Aug 2004, Larry Wall wrote: > On Fri, Aug 20, 2004 at 10:07:02PM +0200, Juerd wrote: > : I'm proposing > : > : for zip(@foos, @bars, @xyzzies) <-> $foo, $bar, $xyzzy { ... } > : for %quux.kv <-> $key, $value { ... } > > That'd probably work on the keys only if the hash was decla

Re: "<->" as "->" with automatic "is rw"

2004-08-20 Thread Matt Diephouse
On Fri, 20 Aug 2004 13:49:46 -0700, Larry Wall <[EMAIL PROTECTED]> wrote: > Yes, a typo. Though it's not actually clear yet whether you have to > write zips args with semicolons, which is why I partially switched > to ¥ in midthink. Just checking. I wondered if you'd introduced a new feature midt

Re: "<->" as "->" with automatic "is rw"

2004-08-20 Thread Larry Wall
On Fri, Aug 20, 2004 at 04:46:33PM -0400, Matt Diephouse wrote: : On Fri, 20 Aug 2004 13:31:12 -0700, Larry Wall <[EMAIL PROTECTED]> wrote: : > It's vaguely possible I could be persuaded on the basis that : > : > for zip @a ¥ @b <-> { ($^a,$^b) = ($^b,$^a) } : : Shouldn't that be: : : fo

Re: "<->" as "->" with automatic "is rw"

2004-08-20 Thread Matt Diephouse
On Fri, 20 Aug 2004 13:31:12 -0700, Larry Wall <[EMAIL PROTECTED]> wrote: > It's vaguely possible I could be persuaded on the basis that > > for zip @a ¥ @b <-> { ($^a,$^b) = ($^b,$^a) } Shouldn't that be: for zip @a, @b <-> { ... } --or-- for @a ¥ @b <-> { ... } ? --

Re: "<->" as "->" with automatic "is rw"

2004-08-20 Thread Larry Wall
On Fri, Aug 20, 2004 at 10:07:02PM +0200, Juerd wrote: : I'm proposing : : for zip(@foos, @bars, @xyzzies) <-> $foo, $bar, $xyzzy { ... } : for %quux.kv <-> $key, $value { ... } That'd probably work on the keys only if the hash was declared to have object keys. At least in Perl 5, the ke