Opened 11 years ago

Closed 11 years ago

#516 closed defect (fixed)

send/stret macro produces Error: unknown arg spec :REGISTERS

Reported by: rongarret Owned by:
Priority: normal Milestone:
Component: Objective-C Bridge Version: trunk
Keywords: Cc:


With e bound to e.g. an event object, I get the following error:

? (ccl::slet ((l (send e 'location-In-Window))))
;Compiler warnings :
;   In an anonymous lambda form: Undeclared free variable E
> Error: unknown arg spec :REGISTERS
> While executing: %FF-CALL, in process Listener(7).

The form eventually macroexpands (through an amazingly byzantine process) into something containing:

                            (LOAD-TIME-VALUE (EXTERNAL "_objc_msgSend")))
                          (OBJC:@SELECTOR "locationInWindow")

which %FF-CALL doesn't seem to know what to do with.

Change History (3)

comment:1 Changed 11 years ago by rme

I would recommend that you don't use SEND, which is basically obsolete. (Yes, the Objective-C bridge chapter in the manual is horribly out-of-date.)

(defclass clicky-view (ns:ns-view)
  (:metaclass ns:+ns-object))

(objc:defmethod (#/mouseDown: :void) ((self clicky-view) event)
  (let ((p (#/locationInWindow event)))
    (#_NSLog #@"you clicked at %@" :id (#_NSStringFromPoint p))))

comment:2 Changed 11 years ago by gb

An explanation for why the error is happening (there's a deeper problem, but this is the short version) is that something's causing the trunk IDE to start out with:

? (ccl:declaration-information 'optimize nil)

in effect.

That discourages the compiler from inlining the call to %FF-CALL (and from doing lots of other things), and exposes the fact that the %FF-CALL function doesn't understand what :registers is all about.

comment:3 Changed 11 years ago by rme

  • Resolution set to fixed
  • Status changed from new to closed

r12241 should fix this

Note: See TracTickets for help on using tickets.