[Openmcl-devel] New snapshots available

Phil pbpublist at comcast.net
Fri Feb 16 05:11:05 UTC 2007


On Feb 15, 2007, at 9:02 PM, Gary Byers wrote:

>
>
> On Wed, 14 Feb 2007, Phil wrote:
>
>>
>> On Feb 14, 2007, at 7:18 PM, Gary Byers wrote:
>>
>>> On Wed, 14 Feb 2007, Phil wrote:
>>>> Gary,
>>>> Great to see progress on supporting Leopard/Obj-C 2.0.  I did  
>>>> have a couple of questions re: the release notes...
>>>> On Feb 14, 2007, at 5:32 AM, Gary Byers wrote:
>>> The bug that I'm aware of has to do with the fact that SEND  
>>> considers
>>> the set of method type signatures in effect when it's used to be  
>>> closed,
>>> so if "foo" is a message declared to return :int at some point in  
>>> time,
>>> a (SEND x 'foo) will compile to something that expects an integer
>>> to be returned and doesn't expect any sort of ambiguity.
>>> If new interfaces are loaded (after that first SEND was compiled)  
>>> and
>>> some disjoint class defines a method on FOO that returns :FLOAT,  
>>> then
>>> any subsequent SEND -should- consider the message to have an  
>>> ambiguous
>>> type signature and should expand into code which does runtime  
>>> typechecking
>>> of the receiver and does a CASE or COND or something to select the
>>> right implementation.
>>> The original SEND - compiled in a simpler world - won't get  
>>> recompiled.
>>> Is this what you're referring to ?  Or are there other cases which
>>> lose ?
>>
>> That would be the issue as I've generated CDB's for many  
>> additional frameworks which work flawlessly for all methods which  
>> don't result in the ambiguous return type scenario.  All releases  
>> I've tried including OpenMCL 1.1-pre-061024, do not appear to be  
>> successful in performing the runtime check so, effectively these  
>> ambiguous methods become uncallable.
>
> Hmm.  Could you give me an example of something that fails once
> ambiguity is introduced ?
>
> I did run into (and hopefully fixed) one case where the type dispatch
> wasn't the correct way of resolving ambiguity.  Many methods are
> defined on some "Protocol" rather than on a class or metaclass, and
> classes that conform to a Protocol inherit that Protocol's methods.
> It's possible for a given message to have methods that're defined
> on both classes and on Protocols, and for those methods to have
> different type signatures.  Any dispatching code has to figure out
> whether a Protocol or class method is applicable in that case (at
> most one method can be applicable.)
>

(ccl::slet ((frame-size (ccl::send (CCL::MAKE-OBJC-INSTANCE
					     'NS-attributed-string
					     :INIT-WITH-STRING
					     "testing") "size"))))

results in:

NonSTRET SEND in (CCL::SEND (CCL::MAKE-OBJC-INSTANCE
                               'NS-ATTRIBUTED-STRING
                               :INIT-WITH-STRING
                               "testing")
                             "size")
    [Condition of type SIMPLE-ERROR]

Restarts:
   0: [ABORT-REQUEST] Abort handling SLIME request.
   1: [ABORT-BREAK] Reset this process
   2: [ABORT] Kill this process

Backtrace:
   0: (CCL::SLETIFY '(CCL::SEND (CCL::MAKE-OBJC-INSTANCE 'NS- 
ATTRIBUTED-STRING :INIT-WITH-STRING "testing") "size") 'T)
   1: (CCL::SLET '(CCL::SLET ((FRAME-SIZE #))) 'NIL)
   2: (FUNCALL #<Compiled-function CCL::SLET Macroexpander #x88C3A9E>)
   3: (MACROEXPAND-1 '(CCL::SLET ((FRAME-SIZE #))) #<PROCESS new-repl- 
thread(223) [Active] #x99835AE>)
   4: (CCL::CHEAP-EVAL-IN-ENVIRONMENT '(#<RESTART ABORT-BREAK  
#x2CC2DDE> #<RESTART ABORT #x2CC2E06>) #<PROCESS new-repl-thread(223)  
[Active] #x99835AE>)
   5: (SWANK::EVAL-REGION "(ccl::slet ((frame-size (ccl::send  
(CCL::MAKE-OBJC-INSTANCE
					     'NS-attributed-string
					     :INIT-WITH-STRING
					     \"testing\") \"size\"))))
" 'T)
   6: (#<Anonymous Function #x95B3626> "(ccl::slet ((frame-size  
(ccl::send (CCL::MAKE-OBJC-INSTANCE
					     'NS-attributed-string
					     :INIT-WITH-STRING
					     \"testing\") \"size\"))))
")


So then I try (which I wouldn't expect to work):

(ccl::send (CCL::MAKE-OBJC-INSTANCE
		     'NS-attributed-string
		     :INIT-WITH-STRING
		     "testing") "size")

results in:

The message "size" must be sent using SEND/STRET
    [Condition of type SIMPLE-ERROR]

Restarts:
   0: [ABORT-REQUEST] Abort handling SLIME request.
   1: [ABORT-BREAK] Reset this process
   2: [ABORT] Kill this process

Backtrace:
   0: (CCL::BUILD-INTERNAL-CALL-FROM-METHOD-INFO #<OBJC-METHOD-INFO - 
[NSAttributedString size] #x98DC686> 'NIL 'NIL '#:G11818 "size" 'NIL  
'NIL)
   1: (CCL::BUILD-SEND-CASE '((#<OBJC-METHOD-INFO - 
[DOMHTMLSelectElement #1=size] #x98DC7AE>) (#<OBJC-METHOD-INFO - 
[NSAttributedString #1#] #x98DC686> #<OBJC-METHOD-INFO -[NSImage #1#]  
#x98DC636> #<OBJC-METHOD-INFO -[NSImageRep #1#] #x98DC5D6>) (#<OBJC- 
METHOD-INFO -[DOMHTMLHRElement #1#] #x98DCA0E> #<OBJC-METHOD-INFO - 
[DOMHTMLFontElement #1#] #x98DC976> #<OBJC-METHOD-INFO - 
[DOMHTMLBaseFontElement #1#] #x98DC8CE> #<OBJC-METHOD-INFO - 
[DOMHTMLInputElement #1#] #x98DC836> #<OBJC-METHOD-INFO - 
[DOMCSSStyleDeclaration #1#] #x98DC706>)) 'NIL 'NIL '#:G11818 "size"  
'NIL 'NIL)
   2: (CCL::BUILD-AMBIGUOUS-SEND-FORM #S(CCL::OBJC-MESSAGE- 
INFO :MESSAGE-NAME #1="size" :METHODS (#5=#<OBJC-METHOD-INFO - 
[NSImageRep #1#] #x98DC5D6> #4=#<OBJC-METHOD-INFO -[NSImage #1#]  
#x98DC636> #3=#<OBJC-METHOD-INFO -[NSAttributedString #1#] #x98DC686>  
#10=#<OBJC-METHOD-INFO -[DOMCSSStyleDeclaration #1#] #x98DC706>  
#2=#<OBJC-METHOD-INFO -[DOMHTMLSelectElement #1#] #x98DC7AE>  
#9=#<OBJC-METHOD-INFO -[DOMHTMLInputElement #1#] #x98DC836> #8=#<OBJC- 
METHOD-INFO -[DOMHTMLBaseFontElement #1#] #x98DC8CE> #7=#<OBJC-METHOD- 
INFO -[DOMHTMLFontElement #1#] #x98DC976> #6=#<OBJC-METHOD-INFO - 
[DOMHTMLHRElement #1#] #x98DCA0E>) :AMBIGUOUS-METHODS ((#2#) (#3# #4#  
#5#) (#6# #7# #8# #9# #10#)) :REQ-ARGS 0 :FLAGS ...) 'NIL 'NIL  
'(CCL::MAKE-OBJC-INSTANCE 'NS-ATTRIBUTED-STRING :INIT-WITH-STRING  
"testing") "size" 'NIL 'NIL 'NIL 'NIL)
   3: (CCL::MAKE-OPTIMIZED-SEND '(CCL::MAKE-OBJC-INSTANCE 'NS- 
ATTRIBUTED-STRING :INIT-WITH-STRING "testing") "size" 'NIL 'NIL)
   4: (CCL::SEND '(CCL::SEND (CCL::MAKE-OBJC-INSTANCE 'NS-ATTRIBUTED- 
STRING :INIT-WITH-STRING "testing") "size") 'NIL)
   5: (FUNCALL #<Compiled-function CCL::SEND Macroexpander #x88CD5D6>)
   6: (MACROEXPAND-1 '(CCL::SEND (CCL::MAKE-OBJC-INSTANCE 'NS- 
ATTRIBUTED-STRING :INIT-WITH-STRING "testing") "size") #<PROCESS new- 
repl-thread(221) [Active] #x99635AE>)
   7: (CCL::CHEAP-EVAL-IN-ENVIRONMENT '(#<RESTART ABORT-BREAK  
#x2CC2DDE> #<RESTART ABORT #x2CC2E06>) #<PROCESS new-repl-thread(221)  
[Active] #x99635AE>)
   8: (SWANK::EVAL-REGION "(ccl::send (CCL::MAKE-OBJC-INSTANCE
		     'NS-attributed-string
		     :INIT-WITH-STRING
		     \"testing\") \"size\")
" 'T)
   9: (#<Anonymous Function #x95B3626> "(ccl::send (CCL::MAKE-OBJC- 
INSTANCE
		     'NS-attributed-string
		     :INIT-WITH-STRING
		     \"testing\") \"size\")
")

>>



More information about the Openmcl-devel mailing list