Leopold Toetsch wrote: > > On Aug 23, 2005, at 22:48, Sam Ruby wrote: > >>> From December 16, 2004: >> >> http://tinyurl.com/8smmq > > Sounds like a really ugly misunderstanding, the more that I've proposed > not to pass the object (P2 in old parlance) out of band. I've stated > several times that calling conventions need changes to properly support > HLLs with minor success at these times.
With the diversity of HLLs out there, I'm not certain that it is wise to declare one set of semantics "proper", thereby implicitly declaring all others "improper". > What I've always said (and what is actually implemented now in the > branch) is that methods gets the object as its first argument. A typical > snippet in PIR code is now > > .sub __abs > .param pmc self > > or if denoted as method: > > .sub __abs method > # 'self' param automagically available > > The first argument of NCI or vtable methods is and was always SELF, > which usually is the invocant and always is the object (the current only > excpetion is an invocation through super()). It might help to anchor this discussion if we focus on a tangible test case. In particular, lets look at the first few lines of the first pie-thon test, which can be found here: http://svn.perl.org/parrot/trunk/languages/python/t/pie/b0.t What code should be generated for the declaration of proto___new__ or proto___repr__ functions? What code should be generated for the various assignment statements in the declaration of the method __new__ inside the MetaToken class? Particularly, the one involving a staticmethod? The conclusion I came to is that there is no way to tell in advance how a given function or method in Python is ever going to be called as there effectively is no difference between the two. - Sam Ruby