On Tue, Mar 22, 2005 at 05:18:44PM +0100, Thomas Sandlaß wrote:
: Rod Adams wrote:
: > multi sub postcircumflex::<[ ]>(MyArray $obj : [EMAIL PROTECTED]) is rw
{...}
: >
: >but I'll wait for S14 before speculating further.
:
: Will that ever be written? And if yes, will it be like S13 which
: is b
Rod Adams wrote:
multi sub postcircumflex::<[ ]>(MyArray $obj : [EMAIL PROTECTED]) is rw {...}
but I'll wait for S14 before speculating further.
Will that ever be written? And if yes, will it be like S13 which
is basically saying that overloading is subsumed by A12/S12?
I see the 'does' operator a
Luke Palmer <[EMAIL PROTECTED]> wrote:
> > Can I use slice notation when dealing with strings?
> >
> >say $string[-1]; # say substr($string, -1);
> >$string[0..2] = "Hello";
>
> No. I'm pretty sure that's the Right Thing, too. First, the "sixth
> element" in a string depends on how you'r
Matt Diephouse wrote:
Is it possible to assign to an array slice?
@array[0..4] = ( 0..4 ); # splice @array, 0, 5, 0..4
If so (and I'm hoping it is), is there an equivalent of Ruby's `[]=`
method? (Is there a way to define this behavior within my own
array-like classes?)
I assign to array and ha
Matt Diephouse writes:
> Is it possible to assign to an array slice?
>
> @array[0..4] = ( 0..4 ); # splice @array, 0, 5, 0..4
Of course. You could in Perl 5, right?
> If so (and I'm hoping it is), is there an equivalent of Ruby's `[]=`
> method? (Is there a way to define this behavior within
Rod Adams writes:
> Come the glorious age of Perl6, will hash slices be enhanced to allow
> things like the following?
>
> [EMAIL PROTECTED]'expected'} = [EMAIL PROTECTED];
Well, you can always do this:
[EMAIL PROTECTED] = [EMAIL PROTECTED];
But I definitely look forward to the definitions
Uri Guttman wrote:
> so we have to get some way to denote a list of indices as a slice and
> also support some range operation as a possible component of that list
> with the knowledge that the range arguments are also indices and not
> just integers.
>
> i don't have any syntax ideas for this at
> "BL" == Bart Lateur <[EMAIL PROTECTED]> writes:
BL> @bar = @foo[(1,2,3)];
BL> is the same as
BL> @bar = (@foo[1], @foo[2], @foo[3]);
BL> or: just an ordinary slice. OTOH,
BL> $bar = @foo[(1, 2, 3)];
BL> is the same as
BL> $bar = (@foo[1], @foo[2], @foo[3]);
the
On Thu, 24 May 2001 22:19:12 -0400, James Mastros wrote:
>But what about: @foo[(1,2,3)]?
>
>Are those parens a list-maker, or are they a scalar expression using
>the comma operator.
Both.
But in this case, I'd say: it depends on the context the slice is called
in.
@bar = @foo[(1,2,3)]
First off, sorry about the noise -- I expect that Larry will have this
mostly worked out already. [And, when I re-read Apocalypse 2, I saw
that I had almost literally stolen some of his sentences. *blush*]
On Thu, May 24, 2001 at 10:19:12PM -0400, James Mastros wrote:
> But what about: @foo[(1,2
From: "Raul Miller" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, May 24, 2001 7:49 PM
Subject: slices
> First: @a[@(...)] looks plausible as a slice syntax. Or -- if you
> specify an array value as an index, shouldn't that be a slice?
I like your second choice better. That is to s
11 matches
Mail list logo