Hello,
I wish to be consistent with shall, so `.' is literal dot in double
strings. I prefer $file.ext or ${file}.ext.
For method calls ``$()'' could be used: $($foo.bar).
Perhaps, what does ${foo.bar} mean?
Best regards
Hans
Larry Wall [EMAIL PROTECTED] writes:
And if we do that, I guess that means that $«file».ext could be
made to work as a replacement, which seems conceptually clean if you
don't think about it too hard.
Now that you put it that way, $( $file ).ext doesn't seem so bad, the
visually-distracting
Larry Wall wrote:
I suppose another approach is simply to declare that dot is always a
metacharacter in double quotes, and you have to use \. for a literal
dot, just as in regexen. That approach would let us interpolate
things like .foo without a variable on the left. That could cause
a great
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?
On Sun, Jul 11, 2004 at 11:06:30PM -0400, Jonadab the Unsightly One wrote:
: 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
On Wed, Jul 14, 2004 at 10:23:18AM -0700, Larry Wall wrote:
: Another alternative is $( $file ).ext. I'd tend to use that before
: ${file}.ext these days. Perhaps that's irrational--but it was hard
: to get the special-case ${name} form to work right in the Perl 5
: lexer, and that bugs me. If
Larry Wall wrote:
On Wed, Jul 14, 2004 at 10:23:18AM -0700, Larry Wall wrote:
: Another alternative is $( $file ).ext. I'd tend to use that before
: ${file}.ext these days. Perhaps that's irrational--but it was hard
: to get the special-case ${name} form to work right in the Perl 5
: lexer, and
On Fri, Jul 09, 2004 at 05:02:48PM +0100, Jonathan Worthington wrote:
Are there plans in Perl 6 for string modifiers?
Not exactly. But method calls can be interpolated into strings, so most
As they are in bash eg.:
${var%glob_or_regexp}
${var%%glob_or_regexp}
my
my $newfile = $str.subst(rx|\.\w+$|, '')\.bin;
But what about the value of $str after interpolation?
In shall it stays it's original value! I would often need,
to use a little modified value of $str for a particular expression.
I like the way shell does it, to be able to write
Luke Palmer [EMAIL PROTECTED] writes:
Gautam Gopalakrishnan writes:
Hello,
I've tried the archives and the 'Perl 6 essentials' book and I can't
find anything
about string subscripting. Since $a[0] cannot be mistaken for array subscripting
anymore, could this now be used to peep into
Piers Cawley skribis 2004-07-12 12:20 (+0100):
method postcircumfix:[] is rw { ... }
Compared to Ruby, this is very verbose.
def [] (key)
...
end
# Okay, not entirely fair, as the Ruby version would also
# need []= defined for the rw part.
Could methods like [] and
[EMAIL PROTECTED] (Juerd) writes:
Could methods like [] and {} *default* to postcircumfix:?
A more interesting question is does it mean anything for them *not* to be
postcircumfix?
After all, the only other use would be $foo.[]($bar, $baz), which is
practically identical. Unless you want to
Simon Cozens skribis 2004-07-12 12:58 (+0100):
[EMAIL PROTECTED] (Juerd) writes:
Could methods like [] and {} *default* to postcircumfix:?
A more interesting question is does it mean anything for them *not* to be
postcircumfix?
Not as a method, I think.
After all, the only other use would
--- Juerd [EMAIL PROTECTED] wrote:
Piers Cawley skribis 2004-07-12 12:20 (+0100):
method postcircumfix:[] is rw { ... }
Compared to Ruby, this is very verbose.
def [] (key)
...
end
# Okay, not entirely fair, as the Ruby version would also
# need []= defined
Luke Palmer [EMAIL PROTECTED] wrote:
Hans Ginzel writes:
On Thu, Jul 08, 2004 at 09:12:16PM +1000, Gautam Gopalakrishnan wrote:
about string subscripting. Since $a[0] cannot be mistaken for array
subscripting
anymore, could this now be used to peep into scalars? Looks easier
than using
On Fri, Jul 09, 2004 at 05:02:48PM +0100, Jonathan Worthington wrote:
: Would that not be:-
:
: say Basename is $(str.subst(rx|.*/|, ''))
:
: I thought when you were interpolating method calls you had to put brackets
: $(object.meth), so that you could still write things like:-
:
: $fh =
Hello,
I've tried the archives and the 'Perl 6 essentials' book and I can't
find anything
about string subscripting. Since $a[0] cannot be mistaken for array subscripting
anymore, could this now be used to peep into scalars? Looks easier than using
substr or unpack. Hope I've not missed anything
Gautam Gopalakrishnan skribis 2004-07-08 21:12 (+1000):
about string subscripting. Since $a[0] cannot be mistaken for array subscripting
anymore, could this now be used to peep into scalars? Looks easier than using
$a[0] is $a.[0]. That means that if there is a @$a, it still is array
Gautam Gopalakrishnan writes:
Hello,
I've tried the archives and the 'Perl 6 essentials' book and I can't
find anything
about string subscripting. Since $a[0] cannot be mistaken for array subscripting
anymore, could this now be used to peep into scalars? Looks easier than using
substr or
On Thu, Jul 08, 2004 at 09:12:16PM +1000, Gautam Gopalakrishnan wrote:
about string subscripting. Since $a[0] cannot be mistaken for array subscripting
anymore, could this now be used to peep into scalars? Looks easier than using
Are there plans in Perl 6 for string modifiers? As they are in
Hans Ginzel writes:
On Thu, Jul 08, 2004 at 09:12:16PM +1000, Gautam Gopalakrishnan wrote:
about string subscripting. Since $a[0] cannot be mistaken for array subscripting
anymore, could this now be used to peep into scalars? Looks easier than using
Are there plans in Perl 6 for string
21 matches
Mail list logo