Prev: A link to a collection of tutorials on LISP.
Next: A link to a collection of tutorials on LISP.
From: Thomas A. Russ on 29 Jun 2010 02:13 "Scott L. Burson" <gyro(a)zeta-soft.com> writes: > On Jun 27, 4:06��pm, Peter Keller <psil...(a)cs.wisc.edu> wrote: > > In my case, I've implemented a master/worker paradigm with distributed > > processes. The master process packs up the worker's task data along with the > > symbol associated with the function on the worker side and sends it to the > > worker process in an RPC-like model. I use cl-serializer, so I actually do send > > the target function's symbol to the client side, which arrives uninterned--it > > could just have easily been the string of the function's name though. > > I haven't used cl-serializer, but I would suggest it is standard > practice for a serializer to preserve the package of a serialized > symbol. I haven't used cl-serializer either, but taking some time to look at the code shows that it does, as expected, preserve the package when a symbol is serialized. The code itself (written with some other funky macros, I guess) is this: (def serializer-deserializer symbol +symbol-code+ symbol (progn (write-generic-string (symbol-name object) context) (serialize-package (symbol-package object) context)) (announce-identity (intern (read-generic-string context) (deserialize-package context)) context)) So, when serializing, it most certainly preserves both the symbol-name and the symbol-package. And it uses the package when deserializing as well. The only symbols that are sent over uninterned are symbols that are uninterned on the sending side. Now I recall Peter mentioning MAKE-SYMBOL at some point up-thread. If that is how he is creating symbols, then he is getting uninterned symbols which will not generally be serializable with identity in any case. I didn't see if there was anything that tried to keep at least some identity going, but using MAKE-SYMBOL to name anything that you want to be able to reference again by name is a bad idea(tm). So, cl-serializer is clearly NOT the problem with losing symbol identity. There must be some other problem like using uninterned symbols in the first place. I suspect MAKE-SYMBOL may be at the root of the problem. -- Thomas A. Russ, USC/Information Sciences Institute
First
|
Prev
|
Pages: 1 2 3 4 5 6 7 Prev: A link to a collection of tutorials on LISP. Next: A link to a collection of tutorials on LISP. |