Re: Perl 6 Meta Object Protocols and $object.meta.isa(?)

2005-08-10 Thread Juerd
Larry Wall skribis 2005-08-09 16:19 (-0700): So either something in the context tells us what Foo means, or it will be taken as a list operator that hasn't been declared yet. Is there, by the way, a pragma to force predeclaration of subs, to gain compile time typo checking? Juerd --

Re: $object.meta.isa(?) redux

2005-08-10 Thread Luke Palmer
On 8/9/05, Larry Wall [EMAIL PROTECTED] wrote: So why not just use describes? Then maybe Object.isa(Foo) delegates to $obj.meta.describes(Foo). Hmm. We have a similar problem with the new class-set notation. These two things: $a.does(Foo); Bar.does(Foo); Mean two different things:

Re: Perl 6 Meta Object Protocols and $object.meta.isa(?)

2005-08-10 Thread Larry Wall
On Wed, Aug 10, 2005 at 10:47:47AM +0200, Juerd wrote: : Larry Wall skribis 2005-08-09 16:19 (-0700): : So either something in the context tells us what Foo means, or : it will be taken as a list operator that hasn't been declared yet. : : Is there, by the way, a pragma to force predeclaration

Re: Perl 6 Meta Object Protocols and $object.meta.isa(?)

2005-08-10 Thread Autrijus Tang
On Wed, Aug 10, 2005 at 10:12:45AM -0700, Larry Wall wrote: We can get away with this in Perl 6 because bindings to positionals happen lazily. So all we have to check for syntactically is that we don't have a subsequent declaration that changes the syntax from list to unary (or none-ary).

Re: Proposal: is defined trait, is typed trait, traits pragma.

2005-08-10 Thread Larry Wall
I'll have to think about the rest of your proposal, but I was suddenly struck with the thought that our platonic Class objects are really forms of undef: say defined IO; # prints 0 That is, we already have an object of type IO that doesn't really have a value yet. And maybe that's the real

Re: Perl 6 Meta Object Protocols and $object.meta.isa(?)

2005-08-10 Thread TSa
HaloO, Luke Palmer wrote: On 8/10/05, TSa [EMAIL PROTECTED] wrote: Here is an example of a 2D distance method role Point { has Num $.x; has Num $.y; } method distance( Point $a, Point $b -- Num ) { return sqrt( ($a.x - $b.x)**2 - ($a.y - $b.y)**2); } [..] # This

Re: Perl 6 Meta Object Protocols and $object.meta.isa(?)

2005-08-10 Thread TSa
HaloO Autrijus, you wrote: Perl 6 in its unannotated form is also (mostly) a typeless languages, with only the five builtin types, much like Perl 5 is. Counting the sigil quadriga as 4, what is the fifth element? And $it.does(LookGood)? -- $TSa.greeting := HaloO; # mind the echo!

Re: Proposal: is defined trait, is typed trait, traits pragma.

2005-08-10 Thread Autrijus Tang
On Wed, Aug 10, 2005 at 10:25:05AM -0700, Larry Wall wrote: I'll have to think about the rest of your proposal, but I was suddenly struck with the thought that our platonic Class objects are really forms of undef: say defined IO; # prints 0 Hmm, bool::false stringifies to '0'? Also,

Re: Perl 6 Meta Object Protocols and $object.meta.isa(?)

2005-08-10 Thread Autrijus Tang
On Wed, Aug 10, 2005 at 07:32:01PM +0200, TSa wrote: you wrote: Perl 6 in its unannotated form is also (mostly) a typeless languages, with only the five builtin types, much like Perl 5 is. Counting the sigil quadriga as 4, what is the fifth element? @ $ % :: In Perl5, :: is replaced by

Re: Proposal: is defined trait, is typed trait, traits pragma.

2005-08-10 Thread Larry Wall
On Thu, Aug 11, 2005 at 01:34:34AM +0800, Autrijus Tang wrote: : On Wed, Aug 10, 2005 at 10:25:05AM -0700, Larry Wall wrote: : I'll have to think about the rest of your proposal, but I was suddenly : struck with the thought that our platonic Class objects are really : forms of undef: : :

Re: set questions -- Re: $object.meta.isa(?) redux

2005-08-10 Thread Larry Wall
On Wed, Aug 10, 2005 at 11:24:02AM -0700, Dave Whipp wrote: : Do Sets get a sigil? Probably not. coughunicodecough : I'd guess that % would be appropriate, because a : hash is simply Set of Pair where the membership equivalence class is : simply $^member.key. What syntax is used to associate

Re: Proposal: is defined trait, is typed trait, traits pragma.

2005-08-10 Thread Autrijus Tang
On Wed, Aug 10, 2005 at 11:24:05AM -0700, Larry Wall wrote: : My current understanding is that the typechecker considers IO to be of : Class type, not of IO type; the fact that IO.does(IO) is true is purely : an illusion created by special dispatch for .does. Well, that's what I thought last

Re: $object.meta.isa(?) redux

2005-08-10 Thread Larry Wall
On Tue, Aug 09, 2005 at 10:55:05PM -0400, Stevan Little wrote: : So why not just use describes? Then maybe Object.isa(Foo) delegates : to $obj.meta.describes(Foo). : : I like that, but is it appropriate for subclasses as well? Well, I suppose we could hedge it as part of a collaboration:

Re: Proposal: is defined trait, is typed trait, traits pragma.

2005-08-10 Thread TSa
HaloO, Autrijus Tang wrote: So I'm starting to write the inferencer. Immediately I encounter the problem that every type can potentially contain undef: This is the reason why I've bounded Undef below Item disjoint with Value in my type lattice. Of course all types are applicable as type

Re: my $pi is constant = 3;

2005-08-10 Thread Larry Wall
On Thu, Aug 11, 2005 at 02:22:04AM +0800, Autrijus Tang wrote: : According to S06: : : my $pi is constant = 3; : : Is this a special form? I believe any assignment to a declarator is potentially a special form, or we can't get assignment to has and state to work right. : If yes, what does

Re: Perl 6 Meta Object Protocols and $object.meta.isa(?)

2005-08-10 Thread TSa
HaloO, Larry Wall wrote: It might be a mistake to call these isa relationships though. I really only care about Package does Object. Module does Package. Role does Module. Class does Role. OK, I've added that and the Set type in my little type lattice. With your Object still

Re: Proposal: is defined trait, is typed trait, traits pragma.

2005-08-10 Thread TSa
HaloO Autrijus, you wrote: I think that's because you live in the static realm already. :) Perhaps, but if yes it is an infinite one. my $x is typed; $x = 123; $x = length($x); Would be a type error. If it's in the dynamic world (as in Perl5), that's just fine. Does that

Re: my $pi is constant = 3;

2005-08-10 Thread Larry Wall
On Thu, Aug 11, 2005 at 02:22:04AM +0800, Autrijus Tang wrote: : According to S06: : : my $pi is constant = 3; Perhaps the actual rewrite is my $pi is constant({ 3 }); much like state $where = $California; is desugared to state $where is first({$California}); or some such,

Re: $object.meta.isa(?) redux

2005-08-10 Thread Dave Rolsky
On Wed, 10 Aug 2005, Luke Palmer wrote: A new development in perl 6 land that will make some folks very happy. There is now a Set role. Among its operations are (including parentheses): (+) Union (*) Intersection (-) Difference (=) Subset () Proper subset (=)

Set operators in Perl 6 [was Re: $object.meta.isa(?) redux]

2005-08-10 Thread Dave Rolsky
[changing the subject line for the benefit of the summarizer ...] On Wed, 10 Aug 2005, Larry Wall wrote: And now some people will begin to wonder how ugly set values will look. We should also tell them that lists (and possibly any-junctions) promote to sets in set context, so that the usual

Re: my $pi is constant = 3;

2005-08-10 Thread TSa
HaloO, Larry Wall wrote: In this case it desugars to my $pi is constant = 3; :-) In other words the assignment to a my turns into an ordinary assignment that happens at runtime. Hopefully, since $pi is marked constant, it could be optimized to a binding in many cases, but that's not the

Re: set questions -- Re: $object.meta.isa(?) redux

2005-08-10 Thread Flavio S. Glock
I wonder if infinite sets (recurrences) will be supported - then I'll move all(ext/Recurrence, ext/Span, ext/Set-Infinite) to Perl6::Container::Set::Ordered - cool. - Flavio S. Glock 2005/8/10, Dave Whipp [EMAIL PROTECTED]: Luke Palmer wrote: A new development in perl 6 land that will make

RE: $object.meta.isa(?) redux

2005-08-10 Thread Joe Gottman
-Original Message- From: Luke Palmer [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 10, 2005 11:53 AM To: TSa Cc: Perl6 Language List Subject: Re: $object.meta.isa(?) redux A new development in perl 6 land that will make some folks very happy. There is now a Set role.

RE: $object.meta.isa(?) redux

2005-08-10 Thread Sam Vilain
On Wed, 2005-08-10 at 21:00 -0400, Joe Gottman wrote: Will there be an operator for symmetric difference? I nominate (^). That makes sense, although bear in mind that the existing Set module for Perl 6, and the Set::Scalar and Set::Object modules for Perl 5 use % for this (largely due to

Re: Proposal: is defined trait, is typed trait, traits pragma.

2005-08-10 Thread Autrijus Tang
On Wed, Aug 10, 2005 at 10:31:40PM +0200, TSa wrote: my $x is typed; $x = 123; $x = length($x); Would be a type error. If it's in the dynamic world (as in Perl5), that's just fine. Does that difference make sense to you? The question remains, when exactly does $x acquire

Re: my $pi is constant = 3;

2005-08-10 Thread Larry Wall
On Wed, Aug 10, 2005 at 11:48:16PM +0200, TSa wrote: : Only that ?$b is not marked is constant? Strange that is. Straight out of the apocalypse--parameters default to constant. Larry

Perl 6 Summary for 2005-08-02 through 2005-08-10

2005-08-10 Thread Matt Fowles
Perl 6 Summary for 2005-08-02 through 2005-08-10 All~ Welcome to another summary, brought to you by chinese food. The attentive among you will notice that this summary is a day late, because I did not feel like doing it yesterday. If only I could do that at work... Perl 6