On 02/08/2015 19:12, Konstantin Weitz wrote:
I'm trying to write a distributed racket program using [places][0]. From my 
current understanding, this means that I have to send data to each place over a 
channel using the `place-channel-put` function, which can send any value 
accepted by `place-message-allowed?`.

I would like to send closures over a channel, unfortunately, closures are not 
accepted by `place-message-allowed?`. Is there any way to serialize a closure 
into a value accepted by a channel, and then deserialize it on the other side 
of the channel?

The closures that I'm trying to send are side-effect free. The closures are 
defined using `lambda`.

[0]: http://docs.racket-lang.org/reference/places.html


Perhaps /quote/ and /eval/ would do the job? That is the usual way to treat Scheme code as data and data as Scheme code. But I don't know if there isn't a better way for already defined closures. You'll probably need to /quote/ the lambda form to get the data graph of the code before sending it to the other place to evaluate it. But then you're not sending the closure but only its form and binding of variables will take place in the other /place/.

--
You received this message because you are subscribed to the Google Groups "Racket 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to