use English

2005-04-26 Thread Aaron Sherman
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 *

Roles as anonymous and/or closures

2005-04-26 Thread Aaron Sherman
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:

invocant vs. topic (was: Re: -X's auto-(un)quoting?)

2005-04-26 Thread Thomas Sandlaß
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 trouble

Re: Roles as anonymous and/or closures

2005-04-26 Thread Juerd
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

Re: Roles as anonymous and/or closures

2005-04-26 Thread Aaron Sherman
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 mixin

Re: invocant vs. topic (was: Re: -X's auto-(un)quoting?)

2005-04-26 Thread Mark Reed
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

Deletion of members by mixin

2005-04-26 Thread Aaron Sherman
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 that brings up

Re: Deletion of members by mixin

2005-04-26 Thread Aaron Sherman
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 hide

Formal Parameters To While Block

2005-04-26 Thread Joshua Gatcomb
as it appears the email I sent before subscribing is being held and I am impatient, I have subsequently subscribed and am resending from a different address 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.

LABELS: block

2005-04-26 Thread Stevan Little
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.

Re: use English

2005-04-26 Thread Luke Palmer
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: *

Re: map { $_ = $_ } @foo

2005-04-26 Thread Thomas Sandlaß
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

Re: Deletion of members by mixin

2005-04-26 Thread Abhijit Mahabal
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

Re: Deletion of members by mixin

2005-04-26 Thread Aaron Sherman
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 course, only

Re: Roles as anonymous and/or closures

2005-04-26 Thread Luke Palmer
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

Re: LABELS: block

2005-04-26 Thread Luke Palmer
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 that

Re: Formal Parameters To While Block

2005-04-26 Thread Luke Palmer
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:while (cond is

Re: LABELS: block

2005-04-26 Thread Juerd
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 of

Re: LABELS: block

2005-04-26 Thread Aaron Sherman
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

Re: LABELS: block

2005-04-26 Thread Juerd
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: :foobar, :quuxxyzzy == map { ... } == my @baz; or you could have a keyword that introduces the label: rx/label

Formal Parameters To While Block

2005-04-26 Thread Joshua Gatcomb
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

Re: LABELS: block

2005-04-26 Thread Dave Whipp
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 function

Adding Complexity

2005-04-26 Thread Jonathan Lang
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,