David Whipp writes: : Piers Cawley [mailto:[EMAIL PROTECTED]] wrote: : > Damian Conway <[EMAIL PROTECTED]> writes: : > > I suppose this discussion also raises the vexed question : > whether ??:: can also be put out to pasture in favour of: : > > : > > $val = if $x { 1 } else { 2 }; : : I like that idea. : : > Only if you can also do: : > : > if $x { $x } else { $y } = 'foo'; : > : > But that looks really scary. : : Its not really of nasty as it looks (IMHO). If we can have an : lvalue context for evaluation of expressions, then I can't : see any real problem. : : We already have the possibility of evaluating a sub in : lvalue context. This is disabled unless the sub has the : lvalue property. Is there any reason why non-sub blocks : shouldn't have this enabled, by default.
It's not a semantic problem, since we already do the identical thing for ?: in Perl 5. However, it *is* a syntactic problem, if lists are allowed to have trailing commas. Then you can't tell if the C<if> is supposed to be a statement modifer or the start of a ??::-style conditional without arbitrarily long lookahead, which is something we try to avoid. Larry