in reply to Re: Perl6 syntax being too much complex? How we will teach and read that?!
in thread Perl6 syntax being too much complex? How we will teach and read that?!

This will probably be used most as 0..., in foreaches:
for zip(@foos, 0...) -> $foo, $i { # Here, $foo is an element of @foo # and $i is its index. }

This would be better written using an array's "kv" method:

for @foos.kv -> $i, $foo { # $i = index; $foo = value }
I think my biggest concern is with the split-vertical-bar operator: strange syntax is most confusing when its only rarely used. "zip" is only 3 chars, and I don't see the huffman benefit of using a single unicode char (which probably requires 3 keystrokes to type, and multiple double-takes to distinguish from a non-split-vertical-bar).

Dave.

Replies are listed 'Best First'.
Re: Re: Re: Perl6 syntax being too much complex? How we will teach and read that?!
by theorbtwo (Prior) on Mar 23, 2004 at 12:24 UTC

    For what it's worth: There's a discussion on perl6-language about why the broken-bar alias for zip is a bad idea. It may well come to pass that zip is alternately spelled ¥ (neumonic: Looks like a zipper. Downside: May cause Japanese people to be confused, because of old hacks that put the ¥ character where \ should be. Type as: AltGr-Shift-Z, German keyboard, xfree86).