[Openmcl-devel] Getting a double-float from ObjC

Sebastian Nozzi sebnozzi at gmx.net
Sat Jun 12 17:55:13 PDT 2004


Hi,

I need to call a method which returns a double-float.
OpenMCL says I need to call it with send/sret (it assumes that it's a 
structure since the return value is big, more than 4 bytes; I don't know 
if the assumption is correct ...?). So I do that, using rlet and all...

(rlet ((the-time :double-float))
	(send/stret the-time
		(send (@class ns-date) :date-with-time-interval-since-now 10000.0d0)
		'time-interval-since-reference-date))

...but it crashes openMCL. In the docs it says that the body evaluates 
and returns whatever type I specified. How do I get a lisp-usable 
number? What I am doing wrong so it crashes? Is send/stret the way to go 
here? (I think, for example, in the case of a normal C function 
returning a double it would just work out of the box...?)

Thanks in advance,

Sebastian



More information about the Openmcl-devel mailing list