From: Sam S. <sd...@gn...> - 2009-08-28 22:08:39
|
Don Cohen wrote: > Sam Steingold writes: > > what would "call back into lisp" mean in this context? > > call a lisp function? > > which lisp thread's STACK would that call use? > > > > the general rule is "only lisp can call a lisp function". > > this includes the situation when lisp calls a foreign function which calla a > > lisp callback, but not the situation when a non-lisp thread calls a lisp function. > > It would make sense to me that a foreign function should be able to > create a lisp thread by calling make-thread. Perhaps it could also do > thread-interrupt. > If the foreign code wants to use the lisp thread to compute a function > that returns results I imagine the lisp code writing results into > foreign data, including some indicator that it's done. absolutely - but this imposes a certain cost, you would not want to start a thread for something trivial or in a tight loop. i.e., the solution to the issue is to start your own thread and call to it whenever you want to evaluate something. btw, here we are entering the "embedding" domain. anyone wants to embed clisp into, say, vim? > The foreign code might also interact with the lisp code via sockets. sure, but then you can also run it in a separate process. |