Re: [Pugs] short-circuit operators

2005-03-17 Thread Larry Wall
On Wed, Mar 16, 2005 at 11:46:46AM -0700, Luke Palmer wrote: : Markus Laire writes: : > Larry Wall wrote: : > >Since it's not a problem for syntax that can be recognized at compile : > >time, your slice above might be allowed if you "declare" the thunks : > >with curlies: : > > : > >@3d_slice =

Re: [Pugs] short-circuit operators

2005-03-16 Thread Luke Palmer
Markus Laire writes: > Larry Wall wrote: > >Since it's not a problem for syntax that can be recognized at compile > >time, your slice above might be allowed if you "declare" the thunks > >with curlies: > > > >@3d_slice = @array[ {!($_ % 2)}; 0..9:3; {?test($_)} ]; > > > > How does the compiler

Re: [Pugs] short-circuit operators

2005-03-16 Thread Markus Laire
Larry Wall wrote: Since it's not a problem for syntax that can be recognized at compile time, your slice above might be allowed if you "declare" the thunks with curlies: @3d_slice = @array[ {!($_ % 2)}; 0..9:3; {?test($_)} ]; How does the compiler know that those ';'s within curlies are List-o

Re: [Pugs] short-circuit operators

2005-03-16 Thread Larry Wall
On Wed, Mar 16, 2005 at 05:33:04PM +0800, Autrijus Tang wrote: : Also, how does that philosophy fit with the bare thunking in array : slices, as listed in A05? : : @3d_slice = @array[ !($_ % 2) ; 0..9:3; ?test($_) ]; If I recall, the discussions around S9 indicated that it might be a bad ide

Re: [Pugs] short-circuit operators

2005-03-16 Thread Autrijus Tang
On Tue, Mar 15, 2005 at 11:04:31PM -0800, Larry Wall wrote: > On Wed, Mar 16, 2005 at 01:30:10PM +0800, Autrijus Tang wrote: > : I wonder if there is a way to expose this trait to the user, > : though... A quick grep did not find anything. Anyone got ideas? > > For the most part we'll delay evalua

Re: [Pugs] short-circuit operators

2005-03-15 Thread Larry Wall
On Wed, Mar 16, 2005 at 01:30:10PM +0800, Autrijus Tang wrote: : On Wed, Mar 16, 2005 at 12:31:05PM +1100, Andrew Savige wrote: : > Ferreting around in the #perl6 logs I noticed an acknowledgement : > that short-circuiting is "borken" as at 15 Maart. Oh well, time : > for the "mad golfer" to dust o

Re: [Pugs] short-circuit operators

2005-03-15 Thread Autrijus Tang
On Wed, Mar 16, 2005 at 12:31:05PM +1100, Andrew Savige wrote: > Ferreting around in the #perl6 logs I noticed an acknowledgement > that short-circuiting is "borken" as at 15 Maart. Oh well, time > for the "mad golfer" to dust off his trusty sand iron and hack > his way out of this punishing Pugs s

Re: [Pugs] short-circuit operators

2005-03-15 Thread Andrew Savige
Ferreting around in the #perl6 logs I noticed an acknowledgement that short-circuiting is "borken" as at 15 Maart. Oh well, time for the "mad golfer" to dust off his trusty sand iron and hack his way out of this punishing Pugs sand trap. :-) /-\ Find local movie times and trailers on Yahoo! Movi

Re: [Pugs] short-circuit operators

2005-03-15 Thread Andrew Savige
--- Ingo Blechschmidt wrote: > Andrew Savige wrote: >> The following program: >> >> my $x = 1; >> my $y = 2; >> $x == 1 or $y = 42; > ^ typo? No, it's not a typo. I was (perhaps not very clearly) trying to demonstrate that the short-circuiting operators, namely: or and && |

Re: [Pugs] short-circuit operators

2005-03-15 Thread Ingo Blechschmidt
Hi, Andrew Savige wrote: > The following program: > > my $x = 1; > my $y = 2; > $x == 1 or $y = 42; ^ typo? > print"x='$x' y='$y'\n"; > > prints x='1' y='2' in perl5, but prints x='1' y='42' in pugs. using r763, it works correctly: $ ./pugs -we 'my $x = 1; my $y = 2; $x == 1 o

Re: [Pugs] short-circuit operators

2005-03-14 Thread Markus Laire
Andrew Savige wrote: Oh, and should I add: use v6; at the top of my Pugs .p6 scripts? (I have no idea what that does, just noticed it in some other example scripts). It tells that script needs perl v6.*.* to work and I think it's good practise to add that to every perl6 script. -- Markus Laire