[EMAIL PROTECTED] wrote:
I am trying to understand the following small portion from S12, and it
seems slightly ambiguous to me:
=== from S12:
You may wish to declare an attribute that is hidden even from the
class; a completely private role attribute may be declared like this:
C
The na
I am trying to understand the following small portion from S12, and it
seems slightly ambiguous to me:
=== from S12:
You may wish to declare an attribute that is hidden even from the
class; a completely private role attribute may be declared like this:
C
The name of such a private attrib
On Thu, Oct 16, 2008 at 02:56:28PM +1100, Timothy S. Nelson wrote:
> Hi all. I'm working on the code for trees that I keep talking about,
> and I have code that somewhat resembles the following:
>
> role Tree::Node does Array {
> has Tree::Node @!children handles ;
> }
>
> The
Hi all. I'm working on the code for trees that I keep talking about,
and I have code that somewhat resembles the following:
roleTree::Node does Array {
has Tree::Node @!children handles ;
}
The intent of this code is that, if you treat the Tree::Node as an
array, you're operatin
On Wed, Sep 01, 2004 at 07:08:57PM +0200, Juerd wrote:
: Larry Wall skribis 2004-09-01 8:02 (-0700):
: > : $x.transform.();
: > That might not work either. This will, though:
: > ($x.transform)();
:
: This is surprising. Can you please explain why .() won't work? I have
: methods return su
Larry Wall skribis 2004-09-01 8:02 (-0700):
> : $x.transform.();
> That might not work either. This will, though:
> ($x.transform)();
This is surprising. Can you please explain why .() won't work? I have
methods return subs quite often, and like that I can just attach ->() to
it to make
On Wed, Sep 01, 2004 at 08:02:33AM -0700, Larry Wall wrote:
: That might not work either. This will, though:
:
: ($x.transform)();
So will
$x.transform()();
for that matter...
Larry
On Wed, Sep 01, 2004 at 10:41:37AM -0400, Aaron Sherman wrote:
: How do you declare attribute functions? Specifically, I was thinking
: about map and what kind of object it would return, and I stumbled on a
: confusing point:
:
: class mapper does iterator {
: has &.transform;
How do you declare attribute functions? Specifically, I was thinking
about map and what kind of object it would return, and I stumbled on a
confusing point:
class mapper does iterator {
has &.transform;
...
}
Ok, that's fine, but what kind of access
At 2:21 PM -0500 4/22/04, Abhijit A. Mahabal wrote:
This is actually a couple of questions:
1: can you extend roles by saying: role Set is extended {}
Parrot will allow this, so if Larry says OK you're fine. It may be
rather significantly expensive, however. (Not nearly as bad as, say,
adding an
On Fri, Apr 23, 2004 at 09:42:51AM -0700, Larry Wall wrote:
: : return $self.keys.grep { exists $other{$^a} }
:
: grepping a hash?
Sorry--looked at that cross-eyed. Of course you can grep the keys...
Larry
On Thu, Apr 22, 2004 at 02:21:17PM -0500, Abhijit A. Mahabal wrote:
: This is actually a couple of questions:
: 1: can you extend roles by saying: role Set is extended {}
Perhaps. Classes and objects that have already composed the role
would have to be notified that they need to recalculate colli
This is actually a couple of questions:
1: can you extend roles by saying: role Set is extended {}
2: if yes, does this change variables for which you said $var does Set?
In other words, is the singleton class like a closure or a first-class
class?
What follows is just some example code in case
Piers Cawley <[EMAIL PROTECTED]> writes:
> Larry Wall <[EMAIL PROTECTED]> writes:
>
>> Piers Cawley writes:
>> : Yeah, that's sort of where I got to as well. But I just wanted to make
>> : sure. I confess I'm somewhat wary of the ';' operator, especially
>> : where it's 'unguarded' by brackets, a
Larry Wall <[EMAIL PROTECTED]> writes:
> Piers Cawley writes:
> : Yeah, that's sort of where I got to as well. But I just wanted to make
> : sure. I confess I'm somewhat wary of the ';' operator, especially
> : where it's 'unguarded' by brackets, and once I start programming in
> : Perl 6 then
>
Piers Cawley writes:
: Yeah, that's sort of where I got to as well. But I just wanted to make
: sure. I confess I'm somewhat wary of the ';' operator, especially
: where it's 'unguarded' by brackets, and once I start programming in
: Perl 6 then
:
: for (@aaa ; @bbb -> $a; $b) { ... }
:
: w
[reformatting response for readability and giving Glenn a stiff talking
to]
Glenn Linderman <[EMAIL PROTECTED]> writes:
> Piers Cawley wrote:
>
>> Okay boys and girls, what does this print:
>>
>> my @aaa = qw/1 2 3/;
>> my @bbb = @aaa;
>>
>> try {
>> print "$_\n";
>> }
>>
>> for @aaa; @bbb ->
That particular example is flawed, because the try expression is turned
into a try statement because the } stands alone on its line.
But if you eliminate a couple newlines between } and for, then your
question makes sense (but the code is not well structured, but hey, maybe
you take out all the n
Okay boys and girls, what does this print:
my @aaa = qw/1 2 3/;
my @bbb = @aaa;
try {
print "$_\n";
}
for @aaa; @bbb -> my $a; my $b {
print "$a:$b";
}
I'm guessing one of:
1:1
2:2
3:3
or a syntax error, complaining about something near
C<@bbb -> my $a ; my $b {>
In other words, how
19 matches
Mail list logo