On Mon, Oct 27, 2003 at 12:05:32PM +1100, Damian Conway wrote:
: Luke Palmer asked:
: >(Or, in this precise case:)
: >
: >    (+$name, +$id) := getinfo();
: 
: Err, no. Or at least: "Please, No!". ;-)
: 
: That would certainly be a way cool abbreviation, but I suspect it would be 
: a Very Bad Idea for unary plus to have two unrelated meanings out in the 
: actual code. I suspect that the "named-only" markers are only available 
: within actual parameter lists.

I don't think there's any ambiguity with it.  A C<:=> always forces its
left side to a binding context.  At that point in the parse, the left
side tree has to be traversed anyway to reinterpret everything, so the
meaning of the C<+> can be determined subsequent to the initial parse.

That being said, there is probably a style of programming enforced
by a stricture that disallows binding to existing variables, for the
same reason that we disallow binding subroutine parameters to global
variables.  In that case, you'd be required to introduce the list
with a C<my>, and so you'd already know you were in a weird context
when parsing.  It could be argued that C<:=> implies a C<my>, in fact.
But I still think it's better to require the C<my> for visual reasons,
and to make it easy to search for declarations.

Larry

Reply via email to