On Tue, 20 Jul 2004 19:15:49 +0200, Juerd <[EMAIL PROTECTED]> wrote:
The Perl 6 Summarizer skribis 2004-07-20 14:46 (+0100):Another subthread discussed interpolation in strings. Larry'schanged
his mind so that "$file.ext" is now interpreted as "$object.method". You
need to do "${file}.ext" or ""$( $file ).ext"". Or maybe "$ÂfileÂ.ext"
by analogy with "%fooÂbarÂ". James Mastros pointed out that "." is
rather ambiguous in a literal string; sometimes a full stop is just a
full stop.
My preference is "$file\.ext". Clear, light and ascii.
Juerd
That's my preference too. But what if we have (perl5) "${n}th occurence" ? "$n\th" won't work because of \t special meaning...
I think, better if . would be interpreted as method call only after \$<ident>, \@<ident>, \%<ident> or \&<ident>, so " ...leading dots?.. hm.." would not require \ before dots, but " text ~#~$obj.method.method2~#~ text" would be interpreted as it should.
I think, real period will be used more often than .topicsMethod interpolating , and "$(.topicsMethod)" or "$_.topicsMethod" look nice enough, so there's no need to add special behavior to . not preceded by sigilled expression..
ah, one more problem. perl5-style "${var}.NotAMethod" could save us in some case, but what if you need to interpolate "$var.method.NotAMethod" ?
should it be "${var.method}.NotAMethod" ?.. or "$($var.method).NotAMethod" is only solution?