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
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
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
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 ~~
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
[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
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
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