Sorry, I wasn't subscribed to perl6-language-objects and didn't even
realize there was a discussion going on.  I just fixed that.

I didn't mean to hijack RFC 103, I can't remember if I'd even looked
at it before... but Nathan seems okay with that and it is a
deceptively large issue.

Version 2 of the RFC went out last night (I'll have to do v3 after
reading these comments) and clarifies a few things (the changes are
all listed at the top).  Most importantly, C<"$weather->temp("F")">
was a typo.  It should have been C<"$weather->temp(\"F\")">.  Also,
RFCs about interpolation of class methods and subroutines also went
out last night, so I'll let them speak for themselves.


Now, about that context thing.  The main conundrum is what to do with
methods that return a list.  Would it be best to just let it be scalar
context?
    
    # $inventory->pinatas returns a list of pinatas we have.
    # "Yes, El Guapo, I would say I have 23 pinatas\n";
    print "Yes, El Guapo, I would say I have $inventory->pinatas pinatas\n";

Or would it be better to expand the returned list, as arrays are
expanded with C<join $", @array>?  Now that I think about it, its
fairly obvious that simple scalar context is best.  Why?  I can't even
think of a useful example of the list expansion.

Most of the time you want to seperate them with a ", " anyway, not
with $".

So junk that bit about the context weirdness.  Simple scalar context it is.


Nathan already covered the questions about evaluating expressions and
arguments.  Perl already does it for everything else.  Furthermore,
interpolating the expression should be simple, as I realized later
while writing the RFC for interpolatoin of subroutines.

  The tokenizer can watch for /&[A-Z_]\w*/i.  If followed by a '(', then the
  parsing becomes the same as for normal subroutine arguments excepting that 
  it must watch for an unescaped closing string character.


I'm also glad to find out Perl already disallows whitespace for other
interpolated constructs.


I appear to have a new version of the RFC ready without the first even
having made it out to the public!


-- 

Michael G Schwern      http://www.pobox.com/~schwern/      [EMAIL PROTECTED]
Just Another Stupid Consultant                      Perl6 Kwalitee Ashuranse
Many people think that an UFO is probably propelled by some kind of
antigravity magnetic motor. I have a totally different thinking. I believe
that an UFO is propelled by jet engine. UFO's gyroscopic body rotates and
serves as its wing to keep UFO's body balanced in the air.
             --Alex Chiu, Immortality Guy

Reply via email to