[Openmcl-devel] Cocoa - small question about send

Dan Knapp dankna at accela.net
Sun Nov 7 14:56:04 PST 2004


   In order to better understand the Cocoa bridge, I'm trying to write 
something
small in it.  Specifically, I want to figure out how exactly an 
interface defined in
a Nib is loaded and used by Lisp code.  I've been reading the example 
source
and making some headway.

   In the course of doing this, I wanted to access the application 
bundle, which
is done with the objc method "mainBundle".  I eventually got that 
working:

CL-USER> (ccl::send (find-class 'ns:ns-bundle) "mainBundle")
#<NS-BUNDLE NSBundle </Applications/openmcl/ccl/OpenMCL.app> (loaded) 
(#x155640)>

   It seems, though, as if my first attempt should have been correct:

CL-USER> (ccl::send (find-class 'ns:ns-bundle) :main-bundle)

Improperly formatted argument list: (:MAIN-BUNDLE)
    [Condition of type SIMPLE-ERROR]

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

Backtrace:
   0: (CCL::%PARSE-MESSAGE ':MAIN-BUNDLE)
   1: (CCL::MAKE-OPTIMIZED-SEND '(FIND-CLASS 'NS:NS-BUNDLE) 
':MAIN-BUNDLE 'NIL 'NIL 'NIL 'NIL #<CCL::DESTRUCTURE-STATE #x85CE8AD6>)
   2: (CCL::SEND '(CCL::SEND (FIND-CLASS 'NS:NS-BUNDLE) :MAIN-BUNDLE) 
'NIL)
   3: (FUNCALL #<Compiled-function CCL::SEND Macroexpander #x659FD4E>)
   4: (MACROEXPAND-1 '(CCL::SEND (FIND-CLASS 'NS:NS-BUNDLE) 
:MAIN-BUNDLE) 'CCL::SEND)
   5: (CCL::CHEAP-EVAL-IN-ENVIRONMENT #<STRING-INPUT-STREAM  #x71CF8BE> 
'(CCL::SEND (FIND-CLASS 'NS:NS-BUNDLE) :MAIN-BUNDLE))
   6: (SWANK::EVAL-REGION "(ccl::send (find-class 'ns:ns-bundle) 
:main-bundle)
[... rest deleted ...]

   Is this a bug in parse-message?  Or is there something I'm not 
understanding?

-- Dan Knapp




More information about the Openmcl-devel mailing list