given too little

2005-11-10 Thread Gaal Yahas
I know why the following doesn't work: given $food { when Pizza | Lazagna { .eat } when .caloric_value $doctors_orders { warn no, no no } # ... } The expression in the second when clause is smart-matched against $food, not tested for truth like an if. So

Re: given too little

2005-11-10 Thread TSa
HaloO, Gaal Yahas wrote: I know why the following doesn't work: given $food { when Pizza | Lazagna { .eat } when .caloric_value $doctors_orders { warn no, no no } # ... } The expression in the second when clause is smart-matched against $food, not tested

Re: given too little

2005-11-10 Thread Eric
On 11/10/05, Gaal Yahas [EMAIL PROTECTED] wrote: I'm a little bothered that this is consistent but (to me, at least) unintuitive. Testing methods on the topic is something people may want to do often: is there a way to hide away the control logic? I'm tempted to propose that when a .method is

Re: given too little

2005-11-10 Thread Gaal Yahas
On Thu, Nov 10, 2005 at 07:23:15AM -0700, Eric wrote: I'm pretty sure i've heard this discussed but checking S04/Switch Statments doesn't make any mention of it. If it has been settled could we get some doc updates? I looked again more carefully at S04 and saw that Any ~~ Code$ and Any ~~

Re: given too little

2005-11-10 Thread Larry Wall
On Thu, Nov 10, 2005 at 10:11:50AM +0100, TSa wrote: : HaloO, : : Gaal Yahas wrote: : I know why the following doesn't work: : : given $food { : when Pizza | Lazagna { .eat } : when .caloric_value $doctors_orders { warn no, no no } : # ... : } : : The

Re: given too little

2005-11-10 Thread Miroslav Silovic
[EMAIL PROTECTED] wrote: If so then my and Eric's wishes are answered: when { $_ 5 } { ... } when { .caloric_value $doctors_orders } { ... } This isn't implemented in pugs yet, but I guess it can be once this is clarified. Actually when $_ 5 { ... } when .caloric_value

Re: given too little

2005-11-10 Thread Rob Kinyon
snarky But if we have a mandatory type inferencer underneath that is merely ignored when it's inconvenient, then we could probably automatically delay evaluation of the code. . . . I'm not so certain that ignoring the mandatory type inferencer is a good idea, even when it's inconvenient. I

Re: Test Case: Complex Numbers

2005-11-10 Thread Luke Palmer
Just some initial thoughts and syntax issues. I'll come back to it on the conceptual side a little later. On 11/10/05, Jonathan Lang [EMAIL PROTECTED] wrote: class complexRectilinear { has $.x, $.y; Hmm, that might need to be has ($.x, $.y); However, inlining hass isn't possible, so