"Stephen P. Potter" wrote:
> 
> You still haven't given a good explanation of
> 
> $a += sub();      # is it a string or a number?
> 
> Does your plan mean that we can no longer have subs that are context
> dependent?

No, Schwern asked me this same thing off list, here's what I said:

One possibility:

   "$a" += foo();

And for the multi-function version I'd say:

   $result = join " ", func1(), func2();

I don't see a solution for that with the C<"" +> proposal, so this is
one issue. Any ideas?

-------
Summarizing, here are the pros/cons of this approach. Please let me know
if I've left any out:

    Pros
    ------------------------------------------------
    - Similar syntax to other HLL's (like .-deref)
    - Semantically separate string concat and
      numeric addition maintained
    - Most functionality maintained

    Cons
    ------------------------------------------------
    - Lose some important . stuff, like with functions
    - The C<"" +> concept actually changes precedence
      of + in certain circumstances, which is weird
    - Parsing C<"" +> as an "op" just ain't that easy

Anyways, I'm not sure of what the fate of this concept is going to be,
and I'm not going to try and fight for it per se. Truthfully, I'd rather
we keep -> and . as-is. I rather like them that way.

However, if Larry decides that .-deref is happening, then this is at
least one alternative of several to ponder, if for no other reason than
it bridges Perl to other HLL's with a syntax/semantics that mostly
works.

-Nate

Reply via email to