As an exercise, I've been looking into what could be done in terms of
creating a complex numbers package that takes advantage of perl 6
technology. A couple of thoughts that I ran across:
When you take the square root of a number, you actually get one of two
possible answers (for instance, sqrt(
Juerd wrote:
...
Or just add quotes (yes, please) and keep the colon:
"foo": for 1... {
next "foo";
}
Given that "next" throws a control-exception that is handled by the
looping construct, perhaps we sohuld think of the label as an optional
parameter to the looping statement funct
All:
Please forgive me, but I have only recently started
following the language side of p6 after spending a
fair amount of time with Parrot. Last night I
installed Pugs and wrote my first p6 code:
http://perlmonks.org/index.pl?node_id=451398
Reading S04, it seems that there are no implicit
block
Aaron Sherman skribis 2005-04-26 16:40 (-0400):
> Is there ever a reason for a leading adverb in a statement or control
> structure?
List of pairs and left-to-right writing:
:foo, :quux ==> map { ... } ==> my @baz;
> or you could have a keyword that introduces the label:
> rx/label +
On Tue, 2005-04-26 at 13:24, Luke Palmer wrote:
> [we'll] redo label syntax later if we must.
Well, of course you run the danger of making it hard for people to
recognize labels which are otherwise common across many languages, but
here's a few ways you could do labels if you need to:
The real
Juerd writes:
> Luke Palmer skribis 2005-04-26 9:28 (-0600):
> > Labels are pretty easy to pick out. I don't believe there is any other
> > thing in the language that, at the beginning of a statement, matches
> > /\w+\:/ . They are certainly available in Perl 6 (as are plain old line
> > labels;
Luke Palmer skribis 2005-04-26 9:28 (-0600):
> Labels are pretty easy to pick out. I don't believe there is any other
> thing in the language that, at the beginning of a statement, matches
> /\w+\:/ . They are certainly available in Perl 6 (as are plain old line
> labels; we're not getting rid o
Joshua Gatcomb writes:
> The solution is formal parameters. The trouble is I
> can't seem to find a good example in S04 that matches
> what I am trying to do.
>
> while $ref() -> @array { ... }
We're thinking at the moment that `while` will probably look like this:
sub statement: (&cond is
Stevan Little writes:
> Hello all,
>
> I have been going over the Synopsis, and I cannot find block labels
> mentioned anywhere. I was under the impression that if it is not
> mentioned, then it can be assumed to be the same as perl5. However, I
> wonder if this is the case with labels given th
Juerd writes:
> (And write classes ucfirst, please)
>
> > return $self but role {
>
> does role { ... }
Nope, Aaron was right here, since you're not trying to mutate $self;
you're just trying to return a new $self with other capabilities.
> > It certainly seems very
On Tue, 2005-04-26 at 12:44, Abhijit Mahabal wrote:
> On Tue, 26 Apr 2005, Aaron Sherman wrote:
> > So, as you can see, in the case of mixins, the hypothetical:
> >
> > role z {
> > has not mymeth;
> > }
Sorry, my bad. I wandered sideways into talking about methods. "has", of
On Tue, 26 Apr 2005, Aaron Sherman wrote:
On Tue, 2005-04-26 at 09:58, Abhijit Mahabal wrote:
On Tue, 26 Apr 2005, Aaron Sherman wrote:
It also might be useful for roles to be able to delete members and
methods from a class like so:
role foo {
has $.x;
has no
Autrijus Tang wrote:
map { $_ => $_; } @foo;
This works too:
map { ;$_ => $_ } @foo;
But () is still only a grouper, so this won't do:
map { ($_ => $_) } @foo;
Does this make sense?
A lot! BTW, is it possible to distinguish methods and subs
from the toplevel, too? That little inference
Aaron Sherman writes:
> On Mon, 2005-04-25 at 22:24 -0500, Rod Adams wrote:
>
> > Not exactly a fair comparison, since it's common to not "use English"
> > due to the $& issue.
> >
> > I suspect that if that was not the case, it would be used more.
>
> The reasons I don't "use English" in P5:
>
Hello all,
I have been going over the Synopsis, and I cannot find block labels
mentioned anywhere. I was under the impression that if it is not
mentioned, then it can be assumed to be the same as perl5. However, I
wonder if this is the case with labels given that "everybody wants the
colon".
C
All:
Please forgive me, but I have only recently started
following the language side of p6 after spending a
fair amount of time with Parrot. Last night I
installed Pugs and wrote my first p6 code:
http://perlmonks.org/index.pl?node_id=451398
Reading S04, it seems that there are no implicit
blo
On Tue, 2005-04-26 at 10:49, Aaron Sherman wrote:
> Quoting S12:
>
> A class's method definition hides any role definition of the
> same name, so role methods are second-class citizens. On the
> other hand, role methods are still part of the class itself, so
> they
On Tue, 2005-04-26 at 09:58, Abhijit Mahabal wrote:
> On Tue, 26 Apr 2005, Aaron Sherman wrote:
>
> > It also might be useful for roles to be able to delete members and
> > methods from a class like so:
> >
> > role foo {
> > has $.x;
> > has not $.y;
> > }
>
> But
I¹m only an amateur linguist, but from a linguistic point of view, there are
several related terms in this space.
The term ³subject² has many meanings in English, including ³topic². But
from a grammatical and linguistic standpoint, there are only two meanings of
³subject², and ³topic² is a distin
On Tue, 2005-04-26 at 09:49, Juerd wrote:
> > return $self but role {
>
> does role { ... }
As I understood (please correct me if I'm wrong), the difference between
"does" and "but" was that does modifies the existing object in-place,
and does creates a copy with the new
On Tue, 26 Apr 2005, Aaron Sherman wrote:
It also might be useful for roles to be able to delete members and
methods from a class like so:
role foo {
has $.x;
has not $.y;
}
But that brings up the issue of who has the final authority. In class
compos
All IIRC/AFAIK:
Aaron Sherman skribis 2005-04-26 9:25 (-0400):
> method make ($self: $make, [EMAIL PROTECTED]) returns(car) {
returns car;
(And write classes ucfirst, please)
> return $self but role {
does role { ... }
> It certainly seems very
Luke Palmer wrote:
My brother asked me to take out the trash. I asked him to do it.
I believe that the subject there is "my brother" in the first sentence
and "I" in the second. The topic is either "to take out the trash" or
just "the trash" throughout (English speakers wouldn't have any trou
Is any of this legal?
class car {
...
method make ($self: $make, [EMAIL PROTECTED]) returns(car) {
return $self but role {
has $.make = $make;
method model($self: $model)
On Mon, 2005-04-25 at 22:24 -0500, Rod Adams wrote:
> Not exactly a fair comparison, since it's common to not "use English"
> due to the $& issue.
>
> I suspect that if that was not the case, it would be used more.
The reasons I don't "use English" in P5:
* Variable access is slower
25 matches
Mail list logo