From: Robert Feldt Date: 2001-12-06T18:29:35+09:00 Subject: [ruby-talk:27662] Re: Sending a Proc to a remote dRuby object On Thu, 6 Dec 2001, Phil Tomson wrote: > Is it even possible to pass a Proc to a remote dRuby object like this? > This is a "classic" q so if its not in the FAQ we should probably move it there. Procs and Threads (and some other type of objects) cannot be marshaled so dRuby will have problems... ;-) Maybe we should list which classes are affected in the FAQ? It has been discussed a lot and I think Matju (and someone more, Chad?) proposed the nicest solution: add a source_code attribute to Proc (or subclass) and redefine proc/lambda so that it sets the attribute if given a string. Then add marshaling and the proper init and you're set. Of course, it would be nice if future Ruby's could marshal all objects but there are real problems with doing this for Procs and Threads so maybe not. The nice thing about the solution above is that when using this feature all you have to do is add a '%': proc %{|x| x*x} etc. Regards, /RobertF