Larry Wall <[EMAIL PROTECTED]> writes:

> No, just currently wrong. :-) I changed my mind about it in A12,
> partly on the assumption that $object.attr would actually be more
> common than $file.ext, 

Speaking of which, what's the cleanest way to interpolate filenames
with a fixed extension now?  "${file}.ext" ?  "$file\.ext" ?

Also, I guess that if "$foo.bar" is taken as a method call, then
"$file.$ext" is going to be trouble also, is that right?  An error?
Or will it treat the value of $ext as the name of a method, or maybe
look for a method starting with $ ?

> but also because a bogus method call is likely to be noticed sooner
> than bad output data, and because noticing goofs sooner rather than
> later is often construed to be a good thing.  (Though this attitude
> can be taken to extremes--see static typing.)

Quite.  Perl6 is last I checked moving in the direction of giving a
more informative error message later, rather than a syntax error
sooner, which IMO is a good thing.  Not that this is a case of that,
but it demonstrates that noticing sooner isn't necessarily always the
best way to go.  (Static typing is certainly an annoying limitation,
and I'm sure there are other examples.)

However, while it's a shame not to be able to interpolate "$file.ext",
I can certainly see the argument for "$object.method" being a common
case, one that I imagine I'll use quite often.

Of course, this leaves open the question of whether there are any
fairly common filename extensions that happen to be spelled the same
as a method on Perl6's string class, that might ought to have a
warning generated...   Are there any three-letter methods on the
string class?  (Maybe there shouldn't be, in the core language...)

-- 
$;=sub{$/};@;=map{my($a,$b)=($_,$;);$;=sub{$a.$b->()}}
split//,"[EMAIL PROTECTED]/ --";$\=$ ;-> ();print$/

Reply via email to