From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by sympa.inria.fr (Postfix) with ESMTPS id DF7A67EF0D for ; Thu, 11 Feb 2016 15:12:19 +0100 (CET) IronPort-PHdr: 9a23:B2MnExUcjz+UO9jltIlzv++9OprV8LGtZVwlr6E/grcLSJyIuqrYZhGBt8tkgFKBZ4jH8fUM07OQ6PC/Hzdcqsve+Fk5M7VyFDY9wf0MmAIhBMPXQWbaF9XNKxIAIcJZSVV+9Gu6O0UGUOz3ZlnVv2HgpWVKQka3CwN5K6zPF5LIiIzvjqbpq8KVOFkD2WX1SIgxBSv1hD2ZjtMRj4pmJ/R54TryiVwMRd5rw3h1L0mYhRf265T41pdi9yNNp6BprJYYAu2pN5g/GLdRCTBuLns4/taj4RLKSA/K4noHTk0XlABJCk7L9kepcI32t37Ctut52TGCMIXIQLo5Q3z296dqTB7wkCpBKTMz/Xv/hcl5jaYdqxWk8U8si7XIaZ2YYaItNpjWeskXEDJM Authentication-Results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=philippe.veber@gmail.com; spf=Pass smtp.mailfrom=philippe.veber@gmail.com; spf=None smtp.helo=postmaster@mail-yw0-f170.google.com Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of philippe.veber@gmail.com) identity=pra; client-ip=209.85.161.170; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="philippe.veber@gmail.com"; x-sender="philippe.veber@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail2-smtp-roc.national.inria.fr: domain of philippe.veber@gmail.com designates 209.85.161.170 as permitted sender) identity=mailfrom; client-ip=209.85.161.170; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="philippe.veber@gmail.com"; x-sender="philippe.veber@gmail.com"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@mail-yw0-f170.google.com) identity=helo; client-ip=209.85.161.170; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="philippe.veber@gmail.com"; x-sender="postmaster@mail-yw0-f170.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0AVAQCXlbxWmaqhVdFehHkGiFWmRIxIhzgHPBABAQEBAQEBARABAQEBAQYNCQkhLoItgi0RHQEbHgMSCQEGNwIkAREBBQEiLgeHYgEDEqI8ggeBMT4xizSBaYJXhQAKGScNUYQXAQUKBIYEiC6DAgstE4EnBZZ3gRQmjBmOdUSMPhEegQ03gj6BUzsuhyOBMAEBAQ X-IPAS-Result: A0AVAQCXlbxWmaqhVdFehHkGiFWmRIxIhzgHPBABAQEBAQEBARABAQEBAQYNCQkhLoItgi0RHQEbHgMSCQEGNwIkAREBBQEiLgeHYgEDEqI8ggeBMT4xizSBaYJXhQAKGScNUYQXAQUKBIYEiC6DAgstE4EnBZZ3gRQmjBmOdUSMPhEegQ03gj6BUzsuhyOBMAEBAQ X-IronPort-AV: E=Sophos;i="5.22,431,1449529200"; d="scan'208,217";a="202657130" Received: from mail-yw0-f170.google.com ([209.85.161.170]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/AES128-GCM-SHA256; 11 Feb 2016 15:12:19 +0100 Received: by mail-yw0-f170.google.com with SMTP id g127so39547030ywf.2 for ; Thu, 11 Feb 2016 06:12:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to:content-type; bh=o3Sn7hnGlVKf3emk86RmSBvFcmSTwRuErKR/VglAzFY=; b=EjPn6yXImIU7C8NOgt0ZXnmr8UsMXHTDLinQAGa97YjMlcHhwEh2j1ToD8HRAaq4UB /isBDnoMtInbgeVWynq7ZNDSMEQZac1HnM0b50hfQfh52gDA7KtI+umTvO/b7kS3Nixg QcP4cHqJFEdvPO48VHB54kXlzHGaCxMojV83tKKHZRejpj2ojNXATcFL7ulGuKiUUIJc a8IXnwy3TTPkSzVORpwRloiQdw289BSdjwH7x4U/WhW+3wx/L6z7Xt42V3ByBfhhxJL+ sML7tVaa/BFOL9qObDAMPT2Y1NGiu0sqW96vOE+GMeyvfHnNWQ/0P78Uar7slTP5j9kA VZ/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:from:date:message-id:subject:to :content-type; bh=o3Sn7hnGlVKf3emk86RmSBvFcmSTwRuErKR/VglAzFY=; b=T9tePLj7CsJfG/VyHKVHPmLdAJcQPlVBYFwbATL3tqwDgxovxYaPxmSGhNskY3+Qvn IkidNFgl0pCI0AHpD2KyfOkjEPAzHNuCgRTxYM/PXYKPknVQLNY4172I4bAAMYFKTCcR 35JWOVl3wq3ub2vOcBXLWrTyIguxdL8HQp0xjxhguRl6WMhL4nN16xeGKkB+B/lo9IAT eD/m/kcPAdEfK2d64T0WNthhgWp+3iVHC+pZzLE0wd23DylJZBG01NZtSx6+y+m0cprt WzSxGVEWwacbt2Q0vd1mykK5SYKUITXA+fGbKZv47THcleLy9C1hvJmJLuJRjtuIgddC h4jg== X-Gm-Message-State: AG10YOQ4wK/8ep+ERBClucxm6do7PXQjN1E6Ms1MmPPUM/b1B2sHiSOqcygfdLfe58rhmsbNfOCfmfD5ran9hg== X-Received: by 10.129.107.66 with SMTP id g63mr9454075ywc.142.1455199937973; Thu, 11 Feb 2016 06:12:17 -0800 (PST) MIME-Version: 1.0 Received: by 10.13.210.197 with HTTP; Thu, 11 Feb 2016 06:11:58 -0800 (PST) From: Philippe Veber Date: Thu, 11 Feb 2016 15:11:58 +0100 Message-ID: To: caml users Content-Type: multipart/alternative; boundary=001a1147ec74615207052b7f23de X-Validation-by: philippe.veber@gmail.com Subject: [Caml-list] Accessing values calculated by Toploop.execute_phrase --001a1147ec74615207052b7f23de Content-Type: text/plain; charset=UTF-8 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. --001a1147ec74615207052b7f23de Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Dear list,

=C2=A0 I&= #39;m having quite some fun interacting with the toplevel using `Toploop` a= nd co., and I am now looking for a way to get the values created during a c= all to `Toploop.execute_phrase`, which sadly only returns a boolean. I woul= d like to get these values as `Obj.t` values, so that I could perform addit= ional computations for certain types.

I'm almost there but not = yet:
=C2=A0 - I can find which values were created and what&#= 39;s their type by collecting `Outcometree.out_path` values when they are p= rinted, but this doesn't give access to the actual value (represented a= s an `Obj.t`).
=C2=A0 - 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= 9;d be interested if somebody knew a solution to this (I mean, besides &quo= t;Don't do it" :).

Cheers,
=C2=A0 Philippe.<= br>


--001a1147ec74615207052b7f23de--