On Tue, 24 Aug 2004, Aaron Sherman wrote:
> On Tue, 2004-08-24 at 11:50, Dave Whipp wrote:
>
> > You're assuming that C<either> in a ternary operator. It
> > could be a binary operator, defined as {eval $RHS if $LHS; return $LHS}. For
> > that interpretation, one might choose a different name (e.g. C<implies>).
> > We could actually define ?? as a binary operator in much the same way.
>
> Yep, and since ~~ auto-topicalizes its lhs for its rhs, your binary ??
> is all you need. I wish I'd seen your message before I sent my recent
> one, as I would have just started from there.
>
> Precedence worries me a bit, since I don't know how ~~ and ?? would fit,
> but it's certainly nice to have this construct use a generic Perl 6
> operator like ~~ and not have to have any ternary constructs in the
> language.
My problem is that then you can't get to the original topic. I think too much
topic-clobbering will be confusing.
say chars($_) > 70 ~~ abbreviate($_) ?? $_; #oops, prints the length
--
Adam Lopresto
http://cec.wustl.edu/~adam/
[MacGyver] is the Martha Stewart of action.
--Patrick J. Mooney