On Sun, Aug 03, 2003 at 02:05:50PM -0400, Brent Dax wrote:
: Larry Wall:
: > argument.  In fact, ??:: could be implemented as an infix:?? macro
: > that does a special parse looking for a subsequent :: token.
: 
: ...which gives us another built-in's implementation.
: 
:     macro infix:?? ($cond, $expr1, $expr2)
:         is parsed(/:w (<Perl6.expr>) <'::'> (<Perl6.expr>)/) {
:         return {
:             if($cond) {
:                 $expr1;   #Last expression is the return value, right?
:             }
:             else {
:                 $expr2;
:             }
:         };
:     }
: 
: Thanks, Larry!

Well, it's not quite so simple.  You have to worry about precedence
in the subexpressions, and you have to make "my" in the subexpressions
leak out of the inner blocks.  Both of these are generic issues,
of course, and probably need more general solutions.

Larry

Reply via email to