Is it possible to send an object to the REPL from application code?

If possible, I would like to be able to send some object from a process to the Erlang shell and bind it to a variable so that I can play with it in the REPL for debugging. Is it possible?

DISCLAIMER: I’m a novice, so take whatever I say with a pinch of salt.

I’m also interested to know that.

But generally speaking, wouldn’t it be easier to send a message to the process and have ot reply with whatever you want?

Sure, just get the pid() of your shell and use it to send the term(), then receive it in the shell:

1> Pid = self().
<0.84.0>
2> Pid ! foo.
foo
3> receive Foo -> Foo end.
foo
4> Foo.
foo
3 Likes