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
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-distrac
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 dea
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,
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.
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
--- Jonadab the Unsightly One <[EMAIL PROTECTED]> wrote:
> 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 a
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?
> > > 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
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}
> >
> >
--- 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
> # nee
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 oth
[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 w
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
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 p
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 = o
"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
t
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 s
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 i
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
> subst
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
subscript
21 matches
Mail list logo