Re: Where is Manhattan Dispatch discussion?

2008-05-06 Thread Ovid
--- John M. Dlugosz [EMAIL PROTECTED] wrote: I want to review and collect the wisdom of what has been discussed before. Someone mentioned this the other day, as being a significant consensus. But I can't find anything in the forum archives. Can someone point to the discussion, position

my TypeName $x;

2008-05-06 Thread Jonathan Worthington
Hi, I'm looking for answers/clarification on what (if taken as individual programs) $x is in each case. my Int $x; # $x is Int protoobject say $x; # Int say $x.WHAT; # Int class Foo { } my Foo $x; # $x is Foo protoobject say $x; # Foo say $x.WHAT; # Foo # This

Re: my TypeName $x;

2008-05-06 Thread Jon Lang
My thoughts: .HOW returns information concerning the implementation type; .WHAT returns information concerning the value type. .HOW and .WHAT stringify to something resembling the declarations that would be used to create them. Also bear in mind that Perl 6 uses prototype-based object

Re: nested 'our' subs - senseless?

2008-05-06 Thread TSa
HaloO, David Green wrote: On 2008-May-3, at 5:04 pm, John M. Dlugosz wrote: What does this mean? our sub outer () { ... our sub inner () { ... } } inner; # defined? I don't know why it would be any more illegal than sub foo { our $var... }. The inner sub would be in the package's

Re: my TypeName $x;

2008-05-06 Thread Jon Lang
Upon further review: It might be possible that $x.WHAT returns a Signature object, with the value type of $x as the invocant (or return type?), and everything else empty. But that merely begs the question of how to introspect a Signature object. If I tell Perl 6 to say a Signature, what gets

Re: my TypeName $x;

2008-05-06 Thread Brandon S. Allbery KF8NH
On 2008 May 6, at 10:15, Jon Lang wrote: Signature? If so, what kind of object does the Signature object return if I ask it to give me its invocant? Surely not another Signature object? Whatever it is that Perl 6 returns in that case Turtle? :) -- brandon s. allbery

Re: Where is Manhattan Dispatch discussion?

2008-05-06 Thread John M. Dlugosz
I'm still in the dark... I find an positions for manhattan distance but no definition of what that is. I did find the alternative pod page earlier. --John Ovid publiustemp-perl6language2-at-yahoo.com |Perl 6| wrote: --- John M. Dlugosz [EMAIL PROTECTED] wrote: I want to review and

Re: Where is Manhattan Dispatch discussion?

2008-05-06 Thread Carl Mäsak
John (): I'm still in the dark... I find an positions for manhattan distance but no definition of what that is. I did find the alternative pod page earlier. I don't have a whole answer for you, but a part that may help. What is generally meant by Manhattan distance is so-called L1 distance,

Re: Where is Manhattan Dispatch discussion?

2008-05-06 Thread Mark A. Biggar
Carl Mäsak wrote: John (): I'm still in the dark... I find an positions for manhattan distance but no definition of what that is. I did find the alternative pod page earlier. I don't have a whole answer for you, but a part that may help. What is generally meant by Manhattan distance is

Re: my TypeName $x;

2008-05-06 Thread TSa
HaloO, Jon Lang wrote: My thoughts: .HOW returns information concerning the implementation type; .WHAT returns information concerning the value type. My addition to these thoughts is that the WHAT and HOW are cascaded. Let's say we start at level 0 with the objects, thingies or however we

Re: Where is Manhattan Dispatch discussion?

2008-05-06 Thread TSa
HaloO, Mark A. Biggar wrote: To do multi method dispatch, you want to select the method that best matches the parameters in the call. The fundamental flaw of metric mmd is that it trades degrees of specificity. Consider the subtype chain E : D : C : B : A where the rule is that having an E it

MMD thoughts 2008

2008-05-06 Thread John M. Dlugosz
TSa Thomas.Sandlass-at-barco.com |Perl 6| wrote: The fundamental flaw of metric mmd is that it trades degrees of specificity. Consider the subtype chain E : D : C : B : A where the rule is that having an E it is better handled by a method dealing with a D than one dealing with an A. The same is

Re: my TypeName $x;

2008-05-06 Thread Jon Lang
TSa wrote: Jon Lang wrote: My thoughts: .HOW returns information concerning the implementation type; .WHAT returns information concerning the value type. BTW, S12 more or less confirms the above: .WHAT returns a prototype object that stringifies to its short name, while .HOW allows

Minimal Distance (Re: Where is Manhattan Dispatch discussion?)

2008-05-06 Thread John M. Dlugosz
Mark A. Biggar mark-at-biggar.org |Perl 6| wrote: To do multi method dispatch, you want to select the method that best matches the parameters in the call. One way to do that is to define a measure for distances between types and they use the method that's at the minimum distance. One simple

Re: Minimal Distance (Re: Where is Manhattan Dispatch discussion?)

2008-05-06 Thread TSa
HaloO, John M. Dlugosz wrote: In C++, which must be resolved at compile time, the overloading resolution mechanism demands that =every= parameter be at least as good of a match, and one strictly better match. So the implementation never guesses if worse-left/better-right is a better fit than

Re: nested 'our' subs - senseless?

2008-05-06 Thread David Green
On 2008-May-6, at 6:07 am, TSa wrote: Just to ensure that I get the our behavior right, consider sub foo { our $inner = 3; } sub bar { our $inner = 4; # redeclaration error? } say $inner; Does this print 3 even when foo was never called? No, it throws an

Re: MMD thoughts 2008

2008-05-06 Thread TSa
HaloO, John M. Dlugosz wrote: OK, why would someone create those forms in the first place? I would think they grow like that historically. A five steps long subtyping chain is not particularly extraordinary. Note that multi entries live outside of classes and their single dispatch. The

Re: Minimal Distance (Re: Where is Manhattan Dispatch discussion?)

2008-05-06 Thread chromatic
On Tuesday 06 May 2008 10:38:38 John M. Dlugosz wrote: I have problems with a simple sum.  The distance is artificially inflated if you make lots of small derivation steps vs one large change.  The concept of derivation steps is ill-defined for parameterized types and types that change

Re: nested 'our' subs - senseless?

2008-05-06 Thread TSa
HaloO, David Green wrote: The assignment happens only when foo() is invoked. However, the variable $*Main::inner is declared at compile-time. Similarly, an our sub inner inside foo() would declare the name, but you couldn't call inner() until after running foo() --or bar()-- since you can't

Re: Minimal Distance (Re: Where is Manhattan Dispatch discussion?)

2008-05-06 Thread Larry Wall
On Tue, May 06, 2008 at 08:20:40PM +0200, TSa wrote: HaloO, John M. Dlugosz wrote: In C++, which must be resolved at compile time, the overloading resolution mechanism demands that =every= parameter be at least as good of a match, and one strictly better match. So the implementation never

Re: MMD thoughts 2008

2008-05-06 Thread Buddha Buck
Sorry to reply to the wrong comment, but I lost the original thread in my mail archives and didn't notice this until now. On Tue, May 6, 2008 at 1:54 PM, John M. Dlugosz [EMAIL PROTECTED] wrote: TSa Thomas.Sandlass-at-barco.com |Perl 6| wrote: The fundamental flaw of metric mmd is that it

Re: Minimal Distance (Re: Where is Manhattan Dispatch discussion?)

2008-05-06 Thread John M. Dlugosz
TSa Thomas.Sandlass-at-barco.com |Perl 6| wrote: HaloO, John M. Dlugosz wrote: In C++, which must be resolved at compile time, the overloading resolution mechanism demands that =every= parameter be at least as good of a match, and one strictly better match. So the implementation never

Re: Minimal Distance (Re: Where is Manhattan Dispatch discussion?)

2008-05-06 Thread John M. Dlugosz
Larry Wall larry-at-wall.org |Perl 6| wrote: On Tue, May 06, 2008 at 08:20:40PM +0200, TSa wrote: HaloO, John M. Dlugosz wrote: In C++, which must be resolved at compile time, the overloading resolution mechanism demands that =every= parameter be at least as good of a match, and one

Re: my TypeName $x;

2008-05-06 Thread Jon Lang
Larry Wall wrote: Jonathan Worthington wrote: role Bar { } my Bar $x; # $x is ??? say $x; # ??? say $x.WHAT; # ??? # This means we can only assign to $x something that does Bar? Correct, and for the same reason. The container checks the role--it has little to do

Re: my TypeName $x;

2008-05-06 Thread Larry Wall
On Tue, May 06, 2008 at 07:01:29PM -0700, Jon Lang wrote: : 1. Apparently, my presumption that $x.WHAT was for retrieving the : value type was wrong; from the above, it's sounding like it is : supposed to retrieve the implementation type. I don't know what you mean by those terms. .WHAT gives

Re: my TypeName $x;

2008-05-06 Thread Jon Lang
On Tue, May 6, 2008 at 8:09 PM, Larry Wall [EMAIL PROTECTED] wrote: On Tue, May 06, 2008 at 07:01:29PM -0700, Jon Lang wrote: : 1. Apparently, my presumption that $x.WHAT was for retrieving the : value type was wrong; from the above, it's sounding like it is : supposed to retrieve the