Re: r25891 - in docs/Perl6/Spec: . S32-setting-library
Daniel Ruoso wrote: Em Sex, 2009-03-20 às 14:08 +0100, Jonathan Worthington escreveu: It's probably a minor issue, but part of me wants Junction to be OK too for explaining stuff. Telling people the default parameter type is Any, to accept anything they can write Object and to accept just junctions you write Junction is pretty clear...having to then explain why you write Any and Object but then junction (lowercase) feels awkward. everything is an Object. not everything is Any. That is still true. junction is a native type that doesn't do Any, and so far it seems to be the only one. The capital vs lowercase J does not change that, it only tells you that you cannot subclass "junction" as you can with non-native objects. I know all of this, I was more arguing for those who don't who need to learn it. :-) Actually, if we support that, we kinda loose the point of making it a native type... I don't quite follow this. The point of having it as native is that you don't need to do a high-level method call to implement the autothreading, since it's a native type, you can assume its representation format and go directly into its guts to get the values... Given method calls are so common in Perl 6 and something we probably want to make pretty fast anyway, I don't know there's a serious performance argument here. But it does bring an interesting point - if we have a Junction role then it's probably something that people can do on their own classes to make their own thingies that auto-threading. Meaning the auto-threading need to do a high-level method call to do that... It had perhaps better require things doing the role to provide the ! eigenstates private though, otherwise the dispatcher is going to be rather unhappy... But... if the dispatcher needs to call it, it shouldn't be private right? or is the dispatcher a specific class that Junction implementation can trust? Well, we've gone from eigenstates being added to Object on one day to needing to remove it from that and make it private in junction a few days later, so I'm still feeling quite "wait and see" on whether it really will end up private. :-) I guess the dispatcher can be trusted, or actually just defined inside the junction class anyway... Jonathan
Re: r25891 - in docs/Perl6/Spec: . S32-setting-library
Em Sex, 2009-03-20 às 14:08 +0100, Jonathan Worthington escreveu: > It's probably a minor issue, but part of me wants Junction to be OK too > for explaining stuff. Telling people the default parameter type is Any, > to accept anything they can write Object and to accept just junctions > you write Junction is pretty clear...having to then explain why you > write Any and Object but then junction (lowercase) feels awkward. everything is an Object. not everything is Any. That is still true. junction is a native type that doesn't do Any, and so far it seems to be the only one. The capital vs lowercase J does not change that, it only tells you that you cannot subclass "junction" as you can with non-native objects. > > Actually, if we support that, we kinda loose the point of making it a > > native type... > I don't quite follow this. The point of having it as native is that you don't need to do a high-level method call to implement the autothreading, since it's a native type, you can assume its representation format and go directly into its guts to get the values... > But it does bring an interesting point - if we have a Junction role > then it's probably something that people can do on their own classes > to make their own thingies that auto-threading. Meaning the auto-threading need to do a high-level method call to do that... > It had perhaps better require things doing the role to provide the ! > eigenstates private though, otherwise the dispatcher is going to be > rather unhappy... But... if the dispatcher needs to call it, it shouldn't be private right? or is the dispatcher a specific class that Junction implementation can trust? daniel
Re: r25891 - in docs/Perl6/Spec: . S32-setting-library
Daniel Ruoso wrote: Em Qua, 2009-03-18 às 18:50 -0700, Larry Wall escreveu: On Wed, Mar 18, 2009 at 06:32:18PM -0700, Jon Lang wrote: : > +method !eigenstates (Junction $j: --> List) : : Shouldn't that be lowercase-j junction? Maybe, though there might be a Junction role involved for subtype matches like that one. It's probably a minor issue, but part of me wants Junction to be OK too for explaining stuff. Telling people the default parameter type is Any, to accept anything they can write Object and to accept just junctions you write Junction is pretty clear...having to then explain why you write Any and Object but then junction (lowercase) feels awkward. Actually, if we support that, we kinda loose the point of making it a native type... I don't quite follow this. But it does bring an interesting point - if we have a Junction role then it's probably something that people can do on their own classes to make their own thingies that auto-threading. It had perhaps better require things doing the role to provide the !eigenstates private though, otherwise the dispatcher is going to be rather unhappy... Jonathan
Re: r25891 - in docs/Perl6/Spec: . S32-setting-library
Em Qua, 2009-03-18 às 18:50 -0700, Larry Wall escreveu: > On Wed, Mar 18, 2009 at 06:32:18PM -0700, Jon Lang wrote: > : > +method !eigenstates (Junction $j: --> List) > : > : Shouldn't that be lowercase-j junction? > Maybe, though there might be a Junction role involved for subtype > matches like that one. Actually, if we support that, we kinda loose the point of making it a native type... daniel
Re: r25891 - in docs/Perl6/Spec: . S32-setting-library
On Wed, Mar 18, 2009 at 06:32:18PM -0700, Jon Lang wrote: : > + method !eigenstates (Junction $j: --> List) : : Shouldn't that be lowercase-j junction? Maybe, though there might be a Junction role involved for subtype matches like that one. Larry
Re: r25891 - in docs/Perl6/Spec: . S32-setting-library
> + method !eigenstates (Junction $j: --> List) Shouldn't that be lowercase-j junction? -- Jonathan "Dataweaver" Lang
r25891 - in docs/Perl6/Spec: . S32-setting-library
Author: lwall Date: 2009-03-18 20:46:15 +0100 (Wed, 18 Mar 2009) New Revision: 25891 Modified: docs/Perl6/Spec/S02-bits.pod docs/Perl6/Spec/S06-routines.pod docs/Perl6/Spec/S09-data.pod docs/Perl6/Spec/S32-setting-library/Containers.pod Log: junctions are now considered a native type with private eigenstates Modified: docs/Perl6/Spec/S02-bits.pod === --- docs/Perl6/Spec/S02-bits.pod2009-03-18 19:04:16 UTC (rev 25890) +++ docs/Perl6/Spec/S02-bits.pod2009-03-18 19:46:15 UTC (rev 25891) @@ -12,9 +12,9 @@ Maintainer: Larry Wall Date: 10 Aug 2004 - Last Modified: 15 Mar 2009 + Lwst Modified: 18 Mar 2009 Number: 2 - Version: 159 + Version: 160 This document summarizes Apocalypse 2, which covers small-scale lexical items and typological issues. (These Synopses also contain @@ -576,7 +576,7 @@ Built-in object types start with an uppercase letter. This includes immutable types (e.g. C, C, C, C, C, -C, C, C, C, C, C, C, +C, C, C, C, C, C, C), as well as mutable (container) types, such as C, C, C, C, C, C, etc. @@ -588,6 +588,11 @@ repeated autoboxing can slow your program more than the native type can speed it up.) +The C type is considered a native type because its internal +representation is fixed, and you may not usefully derive from it +because the intent of junctions is to autothread any method calls +on them. + Some object types can behave as value types. Every object can produce a "WHICH" value that uniquely identifies the object for hashing and other value-based comparisons. Normal objects @@ -937,7 +942,7 @@ C role. (The C function merely returns the most generic C object. Use C to return more specific failures. Use C for the most generic non-failure undefined value. The C -type is also undefined, but excludes C so that autothreading +type is also undefined, but excludes C so that autothreading may be dispatched using normal multiple dispatch rules.) The C type is officially undefined as an item but interpolates @@ -968,7 +973,6 @@ Range A pair of Ordered endpoints; gens immutables when iterated Set Unordered collection of values that allows no duplicates Bag Unordered collection of values that allows duplicates -JunctionSet with additional behaviors Signature Function parameters (left-hand side of a binding) Capture Function call arguments (right-hand side of a binding) BlobAn undifferentiated mass of bits @@ -1028,8 +1032,8 @@ Class Perl 6 standard class namespace RolePerl 6 standard generic interface/implementation Grammar Perl 6 pattern matching namespace -Any Perl 6 object (default routine parameter type, excludes Junction) -Object Perl 6 object (default block parameter type, either Any or Junction) +Any Perl 6 object (default routine parameter type, excludes junction) +Object Perl 6 object (default block parameter type, either Any or junction) A C differs from a normal C in how it handles default values. If the value of a C element is set to the default Modified: docs/Perl6/Spec/S06-routines.pod === --- docs/Perl6/Spec/S06-routines.pod2009-03-18 19:04:16 UTC (rev 25890) +++ docs/Perl6/Spec/S06-routines.pod2009-03-18 19:46:15 UTC (rev 25891) @@ -13,9 +13,9 @@ Maintainer: Larry Wall Date: 21 Mar 2003 - Last Modified: 4 Mar 2009 + Last Modified: 18 Mar 2009 Number: 6 - Version: 105 + Version: 106 This document summarizes Apocalypse 6, which covers subroutines and the @@ -2876,7 +2876,7 @@ The natural way to implement autothreading for multi subs is to simply have the junctional signatures (the ones that can accept -Objects/Junctions as well as Any parameters) match more loosely than +Objects or junctions as well as Any parameters) match more loosely than the non-autothreading versions, and let multiple dispatch find the appropriate sub based on the signature. Those generic routines then end up redispatching to the more specific ones. Modified: docs/Perl6/Spec/S09-data.pod === --- docs/Perl6/Spec/S09-data.pod2009-03-18 19:04:16 UTC (rev 25890) +++ docs/Perl6/Spec/S09-data.pod2009-03-18 19:46:15 UTC (rev 25891) @@ -12,9 +12,9 @@ Maintainer: Larry Wall Date: 13 Sep 2004 - Last Modified: 4 Mar 2009 + Last Modified: 18 Mar 2009 Number: 9 - Version: 30 + Version: 31 =head1 Overview @@ -984,7 +984,7 @@ In particular, if a junction is used as an argument to any routine (operator, closure, method, etc.), and the scalar parameter you are attempting to bind the argument to is inconsistent with the -C type, that routine is "autothreaded", meaning the routine +C type, that routine is "autothreaded", meaning the routin