Tom Christiansen writes:
> I'm just a bit concerned with the general notion that functions would under
> some circumstances trigger in qq guys.  It's a bit odd to explain that 
> things like abs() for $n+3 won't work, but $o->foo() would.  Then again,
> it's already curious with $a[$n+3]. :-)

Variables interpolate.  Method calls from variables interpolate.
Function calls don't.

Seems like it's a win without much explanatory cost.

I was looking through some Java code last night and it was filled
with the idiot

  foo.name + " says " + bar.text + " hello to " + baz.actor

constructions.  I laughed and said "but we have interpolation!"
Then I realized that we don't have interpolation of method calls,
so that code would be written in Perl

  $foo->name . " says " . $bar->text . " hello to " . $baz->actor

which isn't a win!

As we see people write more and more OO programs in the domains of
Java and C++ and other languages, method call interpolation will be
more and more of a win.

It makes parsing the string a dog, though.  You think scan_const
and friends are scary in toke.c now? :-)

Nat

Reply via email to