Re: Conditionally included list elements

2006-06-18 Thread A. Pagaltzis
* Juerd [EMAIL PROTECTED] [2006-06-18 14:10]: pugs my @foo = 1, 2, 3, { 4 if 0 }.(), 5; say @foo.perl [1, 2, 3, 5] bool::true pugs my @foo = 1, 2, 3, { 4 if 1 }.(), 5; say @foo.perl [1, 2, 3, 4, 5] bool::true That’s “conceptually noisy” though… I don’t know if I’d

Re: Conditionally included list elements

2006-06-18 Thread A. Pagaltzis
Hi Stuart, * Stuart Cook [EMAIL PROTECTED] [2006-06-18 15:05]: On 6/18/06, A. Pagaltzis [EMAIL PROTECTED] wrote: Is there a construct in Perl 6 to express this more immediately? Something along the lines of the following would seem ideal: $foo, $bar, ( $baz if $wibble ), $quux How

Re: Conditionally included list elements

2006-06-18 Thread Gaal Yahas
On Sun, Jun 18, 2006 at 05:18:14PM +0200, A. Pagaltzis wrote: pugs sub infix:pv($x, $cond) { $cond ?? ($x,) !! () }; say 1, 2, (3 pv 1), 4 However, what are the evaluation semantics here? Neither the ternary nor the `if`-based solutions evaluate the expression they return if the

Re: Conditionally included list elements

2006-06-18 Thread Larry Wall
On Sun, Jun 18, 2006 at 05:18:52PM +0200, A. Pagaltzis wrote: : Maybe TheLarry can enlighten us… :-) We already have the operator you want. It's spelled Cxx?. :-) Larry

Re: Conditionally included list elements

2006-06-18 Thread A. Pagaltzis
* Larry Wall [EMAIL PROTECTED] [2006-06-18 19:05]: On Sun, Jun 18, 2006 at 05:18:52PM +0200, A. Pagaltzis wrote: : Maybe TheLarry can enlighten us… :-) We already have the operator you want. It's spelled Cxx?. :-) Nice. :-) How’s it used? S03 doesn’t list it. Regards, -- #Aristotle

Re: Conditionally included list elements

2006-06-18 Thread Larry Wall
On Sun, Jun 18, 2006 at 07:27:57PM +0200, A. Pagaltzis wrote: : * Larry Wall [EMAIL PROTECTED] [2006-06-18 19:05]: : On Sun, Jun 18, 2006 at 05:18:52PM +0200, A. Pagaltzis wrote: : : Maybe TheLarry can enlighten us… :-) : : We already have the operator you want. It's spelled Cxx?. :-) : :

Re: Conditionally included list elements

2006-06-18 Thread A. Pagaltzis
* Larry Wall [EMAIL PROTECTED] [2006-06-18 19:40]: On Sun, Jun 18, 2006 at 07:27:57PM +0200, A. Pagaltzis wrote: * Larry Wall [EMAIL PROTECTED] [2006-06-18 19:05]: We already have the operator you want. It's spelled Cxx?. :-) Nice. :-) How’s it used? S03 doesn’t list it. Nope. Doesn't