Using references from the shell?
Wed Aug 20 17:59:22 CEST 2003
On Wed, 2003-08-20 at 16:27, Pierpaolo BERNARDI wrote:
> From: "Massimo Cesaro" <massimo.cesaro@REDACTED>
> > The question is, can I handle references from the shell, or am I
> > supposed to write a test module and pass references as opaque values?
> As far as I understand, the whole point of references is that they are
> unforgeable. If there existed a way to obtain the reference from
> its printed representation then this would be vanified.
I (naively?) thought that references are really for creating unique
values even on a distributed system. I never thought to them as
Anyway, I found a workaround for testing my modules from the shell. The
trick is in using a shell variable to hold the reference value:
Now the Rf variable holds the value of the make_ref()'ed call id
returned by otr_switch:resolve/3. otr_switch:get_call_id/1 is just a
helper that extracts the reference from a list.
Then I can use the reference like this:
> Perhaps you can do:
> R = ets:lookup(...), func(R).
Thanks for the info,
More information about the erlang-questions