>>>>> "LW" == Larry Wall <[EMAIL PROTECTED]> writes:

  LW> On Tue, Jul 20, 2004 at 08:42:48PM -0400, Uri Guttman wrote:

  LW> Many expressions are naturally scalar even in list context.  Most
  LW> operators force scalar context unless you hyper them.  In particular,
  LW> the new unary operators C<+>, C<~>, and C<?> are specifically designed
  LW> to force scalar context in a huffmanly efficient way.  Seems a little
  LW> silly to duplicate that with something longer.

someone mailed me off list about those. but you have to decide on
number/string/boolean context when you arelady have string context
surrounding it. seems like context overkill. what i liked about $() was
it just provided scalar context and the string context was provided by
"".

  LW> If you want symmetry you can always use a redundant C<*> in C<[EMAIL PROTECTED]>
  LW> to go with the redundant C<~> in C<{~$bar}>.

that is frumious IMO. 

  LW> : i don't think "$foo.bar" should be a method call. it is too easy to
  LW> : accidentally write and i bet many will fall into that trap. also it may
  LW> : generate a very odd runtime (since it is not a method call with a
  LW> : signature or declaration, it can't (easily?) be checked at compile time)
  LW> : message that may be hard to actually tie back to the string in question.
  LW> : so i would say, make interpolating method calls a little harder because
  LW> : it won't be done as often as simpler stuff (huffman) and it should be
  LW> : marked off as something completely different than simple variable
  LW> : interpolation.

  LW> That's the direction we're heading.

same direction, different lane on the highway :)

  LW> : so method calls would need the $() or @() wrappers as do all expressions
  LW> : beyond simple scalar value lookup. that means $foo, @foo[0], $foo[0],
  LW> : %foo{'bar'} and $foo{'bar'} all interpolate and only their variants
  LW> : (longer index/key expressions) do as well.

  LW> I'm inclining more towards the "only interpolate things that end with
  LW> brackets or parens" rule.  That would allow $foo.bar() to interpolate,
  LW> but not $foo.bar.

and i assume $foo is still fine even though it doesn't end in a bracket?
and also i assume you mean any of }, ] or )?

how would you put in the literal string $foo.bar()? escaping the . or
the ( ?

  LW> Unlike in Perl 5, Perl 6's references will (by default) autodereference
  LW> to their representation in string context.  (Not to be confused with
  LW> scalar context, where they remain references.)  You have to do something
  LW> explicit to get the SCALAR(0xdeadbeef) form of output.  I don't know what
  LW> that syntax is yet.

that can be some longer func name as it is rarely needed IMO. mostly
debugging and some odd places that in p5 used it for a unique key or
class name.

  LW> I probably shouldn't be thinking about that anyway.  Can you all tell
  LW> I'm putting off writing my OSCON talk?  :-)

you too?! i would have never take you for a procrastinator! :)
i just wrote my main draft of my slides the other day. 

why put off something today when you can put it off tomorrow?

uri

-- 
Uri Guttman  ------  [EMAIL PROTECTED]  -------- http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs  ----------------------------  http://jobs.perl.org

Reply via email to