On Tuesday, November 18, 2003, at 12:15 PM, Luke Palmer wrote:
Oh, and if you really want to do that return thing without using a
C<given>, you can just:

    sub blah {
        return $a || goto CONT;
    CONT:
        ...
    }

I don't see what's wrong with that. :-p

Umm... refresh my/our memory. Did we end up having a post- form of C<given>, such that:


return $_ if given $big.long.calculation.{ with }{ some }{ stuff };

does what I might suppose it does, or does it have to be... longer?


(The point of that old thread was to try and find the smallest possible way to write annoyingly common constructs like:


method foo ($self: $a,$b,$c) {
return $self.cached.{ $a }{ $b }{ $c } # short-circuit calculation,
if $self.cached.{ $a }{ $b }{ $c }; # if possible


        ... otherwise do actual stuff ...
    }

but I don't recall the official recommended solution.)


Forgive the craptacularness of my current P6 knowledge, I have been preoccupied with life-involving stuff, with items and things and doohickies.


MikeL



Reply via email to