caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] Accessing values calculated by Toploop.execute_phrase
@ 2016-02-11 14:11 Philippe Veber
  2016-02-11 14:28 ` Thomas Refis
  0 siblings, 1 reply; 4+ messages in thread
From: Philippe Veber @ 2016-02-11 14:11 UTC (permalink / raw)
  To: caml users

[-- Attachment #1: Type: text/plain, Size: 950 bytes --]

Dear list,

  I'm having quite some fun interacting with the toplevel using `Toploop`
and co., and I am now looking for a way to get the values created during a
call to `Toploop.execute_phrase`, which sadly only returns a boolean. I
would like to get these values as `Obj.t` values, so that I could perform
additional computations for certain types.

I'm almost there but not yet:
  - I can find which values were created and what's their type by
collecting `Outcometree.out_path` values when they are printed, but this
doesn't give access to the actual value (represented as an `Obj.t`).
  - I could use `Toploop.getvalue`, but then I could not get results of
evaluations that were not bound to a variable.

Of course I know what I'm trying to do is highly unsafe, so I should
probably think of some other design. Still, out of curiosity, I'd be
interested if somebody knew a solution to this (I mean, besides "Don't do
it" :).

Cheers,
  Philippe.

[-- Attachment #2: Type: text/html, Size: 1159 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-02-11 15:42 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-02-11 14:11 [Caml-list] Accessing values calculated by Toploop.execute_phrase Philippe Veber
2016-02-11 14:28 ` Thomas Refis
2016-02-11 15:37   ` Philippe Veber
2016-02-11 15:42     ` Thomas Refis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).