Re: objective-c question
Denis Pousseur <denis.pousseur@gmail.com> writes:
> Hello list,
>
> is it safe to call an objective-c method defined in lisp from an
> external objective-c frameworks ?
It depends.
> I did that without problem in the past, but now I experiment some
> trouble with a more complex situation :
>
> A delegate method is defined in objective-c that is called by a
> notification of the system. This delegate does a certain job and then
> calls another method on another class, the two defined in lisp (using
> performSelector to avoid compilation warning). Finally, the lisp-objc
> method calls the objective-c frameworks again to finish the job using
> some data processed in lisp. All of these codes run in the main
> thread.
If all is done from the Objective-C main thread, it should be ok (from
the point of view of Objective-C).
> During the lisp part of the process, I got some very strange errors,
> like structure writers that are suddenly declared undefined… Because
> of the common objective-c runtime, I thought that I can go from
> objective-c codes to lisp codes and vice-versa without any problem,
> but maybe I forget an important thing…
There could be problems from the point of view of Lisp, with respect to
the garbage collector, or with interactions between the lisp condition
system and the Objective-C exception system. If the implementation
doesn't handle it, then your functions and methods should (use try/catch
and handler-case in all those embedded functions)
--
__Pascal Bourguignon__ http://www.informatimago.com/
“The factory of the future will have only two employees, a man and a
dog. The man will be there to feed the dog. The dog will be there to
keep the man from touching the equipment.” -- Carl Bass CEO Autodesk
_______________________________________________
Lisp Hug - the mailing list for LispWorks users
lisp-hug@lispworks.com
http://www.lispworks.com/support/lisp-hug.html