On Tue, Jul 28, 2009 at 10:42:01PM +0200, Moritz Lenz wrote:
: I guess when I initialize @a[0] = [] it's the same, because then @a[0]
: is still a scalar, right?
No, as in Perl 5 [] still produces a scalar object that hides the arrayness
from list context, so it's like:
$b = [];
@a[0] = $
Damian Conway wrote:
> Mark J. Reed wrote:
>> My understanding is that the P6 way to do that is to return a Capture
>> containing the desired return values (which can lazily do things only
>> when accessed) in the appropriate slots.
>
> Return a Capture or a more heavily overloaded object, dependin
On Tue, Jul 28, 2009 at 01:22:28PM -0700, Jon Lang wrote:
: Larry Wall wrote:
: > Moritz Lenz wrote:
: > : Either it's parsed as '@a[0] = (W, W)' (list assignment), then @a should
: > : get both elements, and so should @z.
: >
: > Not according to S03, at least by one reading. �...@a[0] as a scalar
Mark J. Reed wrote:
> My understanding is that the P6 way to do that is to return a Capture
> containing the desired return values (which can lazily do things only
> when accessed) in the appropriate slots.
Return a Capture or a more heavily overloaded object, depending on how
fine a degree of co
Jon Lang wrote:
> Larry Wall wrote:
>> Moritz Lenz wrote:
>> : Either it's parsed as '@a[0] = (W, W)' (list assignment), then @a should
>> : get both elements, and so should @z.
>>
>> Not according to S03, at least by one reading. @a[0] as a scalar
>> container only wants one item, so it only take
My understanding is that the P6 way to do that is to return a Capture
containing the desired return values (which can lazily do things only
when accessed) in the appropriate slots.
On 7/28/09, Jon Lang wrote:
> Larry Wall wrote:
>> Moritz Lenz wrote:
>> : Either it's parsed as '@a[0] = (W, W)' (l
Thanks for the quick reply.
Larry Wall wrote:
> On Tue, Jul 28, 2009 at 09:24:40PM +0200, Moritz Lenz wrote:
> : sub W () { substr(eval('want'), 0, 1) }
> : ...
> :
> : # line 560:
> : {
> : my @a;
> : my @z = (@a[0] = W, W);
> : #?rakudo 2 todo 'want function'
> : is(@a, 'L',
Larry Wall wrote:
> Moritz Lenz wrote:
> : Either it's parsed as '@a[0] = (W, W)' (list assignment), then @a should
> : get both elements, and so should @z.
>
> Not according to S03, at least by one reading. �...@a[0] as a scalar
> container only wants one item, so it only takes the first item off
On Tue, Jul 28, 2009 at 09:24:40PM +0200, Moritz Lenz wrote:
: sub W () { substr(eval('want'), 0, 1) }
: ...
:
: # line 560:
: {
: my @a;
: my @z = (@a[0] = W, W);
: #?rakudo 2 todo 'want function'
: is(@a, 'L','lhs treats @a[0] as list');
: is(@z[0], 'L', 'lhs treats @a[0]
Author: pmichaud
Date: 2009-07-28 21:45:55 +0200 (Tue, 28 Jul 2009)
New Revision: 27784
Modified:
docs/Perl6/Spec/S04-control.pod
Log:
Fix incorrect specification of implicit $_ in blocks.
Modified: docs/Perl6/Spec/S04-control.pod
==
I'm in the mood to question my sanity, so I'm seeking feedback for some
test mangling:
In t/spec/S03-operators/assign.t there are some tests that cause me a
headache. I'm trying to re-write them to not use the now-gone want()
function, but I'd have to understand them first ;-)
A good example is t
Moritz Lenz wrote:
Ben Morrow wrote:
- Presumably when an exception is thrown through a block, the LEAVE and
POST queues are called (in that order).
POST was inspired from the Design By Contract department, and are meant
to execute assertions on the result. If you leave a block through an
e
12 matches
Mail list logo