implied looping (was: Re: type sigils redux, and new unary ^ operator)

2005-11-23 Thread Ruud H.G. van Tol
(in pugs). With implied looping that would be 10 lines, starting with two 0-lines. -- Grtz, Ruud

Re: implied looping (was: Re: type sigils redux, and new unary ^ operator)

2005-11-23 Thread Michele Dondi
On Wed, 23 Nov 2005, Ruud H.G. van Tol wrote: for ^5 { say } # 0, 1, 2, 3, 4 The 'for' can go if a list (and also an array) would imply looping, when it is positioned next to a block: a. say (0..4); b. { say; say } (0..4); I'm not really sure: while I like it for its conciseness -and

Re: implied looping

2005-11-23 Thread Ruud H.G. van Tol
Ruud H.G. van Tol: b. { say; say } (0..4); b. now produces 2 lines with 01234 (in pugs). With implied looping that would be 10 lines, starting with two 0-lines. Standard: do {say; say} for 0..4 for 0..4 {say; say} Wishful: (0..4) ยป{say; say} pugs doesn't seem to do the (f,oo,bar

Re: implied looping (was: Re: type sigils redux, and new unary ^ operator)

2005-11-23 Thread Larry Wall
) { say; say } : d. @{0..4} { say; say } : (etc.) : : b. now produces 2 lines with 01234 (in pugs). Which is wrong by the current spec, by the way. It should be a syntax error to have two terms in a row. Bare parens can't be function args unless they're abutted or use .. : With implied looping

Re: implied looping (was: Re: type sigils redux, and new unary ^ operator)

2005-11-23 Thread Juerd
Larry Wall skribis 2005-11-23 9:19 (-0800): ^5.each { say } Without colon? Juerd -- http://convolution.nl/maak_juerd_blij.html http://convolution.nl/make_juerd_happy.html http://convolution.nl/gajigu_juerd_n.html

Re: implied looping

2005-11-23 Thread TSa
Larry Wall wrote: On Wed, Nov 23, 2005 at 06:21:56PM +0100, Juerd wrote: : Larry Wall skribis 2005-11-23 9:19 (-0800): : ^5.each { say } : : Without colon? Yeah, that one doesn't work a couple of way. Unfortunately .each still binds tighter than ^ too. So it'd have to be:

[OT] (was: Re: implied looping)

2005-11-23 Thread Ruud H.G. van Tol
Larry Wall: I can see the mathematical appeal of coming up with a language in which there is a meaning for every possible combination of tokens. Yes, that sounds like my language. I agree it's not Perl. And not a lot of other things too.g It's a counterintuitive fact that languages that