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 A9118823D7 for ; Sat, 10 Mar 2018 18:55:13 +0100 (CET) Authentication-Results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=mail@matej-kosik.net; spf=SoftFail smtp.mailfrom=mail@matej-kosik.net; spf=SoftFail smtp.helo=postmaster@matej-kosik.net Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of mail@matej-kosik.net) identity=pra; client-ip=145.239.83.105; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="mail@matej-kosik.net"; x-sender="mail@matej-kosik.net"; x-conformance=sidf_compatible Received-SPF: SoftFail (mail2-smtp-roc.national.inria.fr: domain of mail@matej-kosik.net is inclined to not designate 145.239.83.105 as permitted sender) identity=mailfrom; client-ip=145.239.83.105; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="mail@matej-kosik.net"; x-sender="mail@matej-kosik.net"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: SoftFail (mail2-smtp-roc.national.inria.fr: domain of postmaster@matej-kosik.net is inclined to not designate 145.239.83.105 as permitted sender) identity=helo; client-ip=145.239.83.105; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="mail@matej-kosik.net"; x-sender="postmaster@matej-kosik.net"; x-conformance=sidf_compatible; x-record-type="v=spf1" IronPort-PHdr: =?us-ascii?q?9a23=3AtSm34R8rb5wRvP9uRHKM819IXTAuvvDOBiVQ1KB4?= =?us-ascii?q?1ukcTK2v8tzYMVDF4r011RmVBd6ds6oMotGVmpioYXYH75eFvSJKW713fDhBt/?= =?us-ascii?q?8rmRc9CtWOE0zxIa2iRSU7GMNfSA0tpCnjYgBaF8nkelLdvGC54yIMFRXjLwp1?= =?us-ascii?q?Ifn+FpLPg8it2O2+55Pebx9UiDahfLh/MAi4oQLNu8cMnIBsMLwxyhzHontJf+?= =?us-ascii?q?RZ22ZlLk+Nkhj/+8m94odt/zxftPw9+cFAV776f7kjQrxDEDsmKWE169b1uhTF?= =?us-ascii?q?UACC+2ETUmQSkhpPHgjF8BT3VYr/vyfmquZw3jSRMMvrRr42RDui9b9mRgHohi?= =?us-ascii?q?kaNDA3/m/YhcNsg6xUux+hux9yzpTIbI2JOvdzfKXQds4aS2pbWcZRUjRMDISm?= =?us-ascii?q?YIsTEeUBP/tToYz6p1gBsxy+BhSnCeTqyjBSh3/22bY30+E7HgHawgMgHcsCsH?= =?us-ascii?q?fTrNXuNacSUvq5zK/WwjXfdv5b3yr25obPchAku/6MXLRwfNLVyUkoCwzKlEmQ?= =?us-ascii?q?qY3iPzOTzOgNt2+b4PZmWOmyiGAnsxl8riWgy8oskIXFmIwYx1Te+Sh6zos5P8?= =?us-ascii?q?C0RFJ7bNK8FJZdtzuWO5ZqTs88WW1kpik3xqMctZKmfCUHy5IqzAPFZfOdaYiH?= =?us-ascii?q?+BfjWf6RIThmgHJlf6qyhxOo/ki81OL8VNC40FVNripek9nMtWoB1xrN5cibUv?= =?us-ascii?q?d9/0Gh1iiT1w3L9+1JLkA5mbDFJ5MvxrM8jJkevErZEiPrhEn7jLeadkA+9eip?= =?us-ascii?q?7+TnbK/mppiZN4JsjwHxKKUumsikDOQ9KAcOQ3aU+eal2L3g+k35W7RKjv4snq?= =?us-ascii?q?nfrp/aOdwXprSlDA9NzoYj9xG/Ai+639sCmHkHKEtJeBaGj4jyJ1HDO+v4DPe6?= =?us-ascii?q?g1S0ijhn3fHGPrv7ApXMNHfPirnhfawuo3JbnQE6yNQa45NPFpkAJujyUwn/ro?= =?us-ascii?q?/2FBg8Zim93+vlQPZ6JAYdETaKC66dGKbbrVKKo+EoOOiPIokYpGCueLAe+/fy?= =?us-ascii?q?gCphyhcmdq6z0M5PMSHqLrFdO0ycJEHUrJIEGGYOsBA5SbW12liLTTNRInW1RK?= =?us-ascii?q?M/oDc2FND9VNuRdsWWmLWEmRyDMNhOfGkfVQKJGGvldcCHXOwNa2SUL9MzymVZ?= =?us-ascii?q?B4jkcJco0FSVjCG/y7djKbOLqCgRqZ/hkdty/OzQ0xc/6W4vAg=3D=3D?= X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A0DMHABjG6Ra/2lT75FeHgEGDINQaWyDe?= =?us-ascii?q?IsSkBqWR4hBHQkFMBMBAgEBAQEBAQEBAWongjgignMPAXsCJgJsCAEBhRiqZII?= =?us-ascii?q?mhG+DSCeCGoENhCiDAoMRiHKCPIJiBJpWCZBciRKFVpJ0NiAmgSx7CjqCRIF1A?= =?us-ascii?q?YJRjAwBAQE?= X-IPAS-Result: =?us-ascii?q?A0DMHABjG6Ra/2lT75FeHgEGDINQaWyDeIsSkBqWR4hBHQk?= =?us-ascii?q?FMBMBAgEBAQEBAQEBAWongjgignMPAXsCJgJsCAEBhRiqZIImhG+DSCeCGoENh?= =?us-ascii?q?CiDAoMRiHKCPIJiBJpWCZBciRKFVpJ0NiAmgSx7CjqCRIF1AYJRjAwBAQE?= X-IronPort-AV: E=Sophos;i="5.47,451,1515452400"; d="scan'208";a="317341087" Received: from 105.ip-145-239-83.eu (HELO matej-kosik.net) ([145.239.83.105]) by mail2-smtp-roc.national.inria.fr with ESMTP; 10 Mar 2018 18:55:13 +0100 Received: from [192.168.1.11] (adsl-dyn-158.95-102-242.t-com.sk [95.102.242.158]) by matej-kosik.net (Postfix) with ESMTPSA id 19B541FB35 for ; Sat, 10 Mar 2018 18:55:12 +0100 (CET) To: caml-list@inria.fr From: =?UTF-8?B?TWF0ZWogS2/FocOtaw==?= Openpgp: id=1CD41D0A52319DC7ABC1B79F50AFFA128CE48649; url=http://matej-kosik.net/doc/kosik.asc Message-ID: Date: Sat, 10 Mar 2018 18:55:10 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Subject: [Caml-list] a question about Ocaml toplevel behavior Hi, I've noticed that Ocaml (4.06.1) toplevel displays: instead of the actual term even if the value does not belong to an abstract data type. Question #1: Is this the expected behavior? My interaction with Ocaml toplevel was: # #load "misc_.cmo";; # #load "warnings_.cmo";; # #load "config_.cmo";; # #load "identifiable_.cmo";; # #load "numbers_.cmo";; # #load "arg_helper_.cmo";; # #load "clflags_.cmo";; # #load "location_.cmo";; # #load "docstrings_.cmo";; # #load "syntaxerr_.cmo";; # #load "ast_helper_.cmo";; # #load "longident_.cmo";; # #load "parser_.cmo";; # #load "lexer_.cmo";; # "foo" |> Lexing.from_string |> Parser_.implementation Lexer_.token_with_comments;; - : Parsetree_.structure = [{Parsetree_.pstr_desc = Parsetree_.Pstr_eval ({Parsetree_.pexp_desc = Parsetree_.Pexp_ident ; pexp_loc = ; pexp_attributes = []}, []); pstr_loc = }] In the last response above, "" appears twice. In my opinion, in each case the actual term should have been printed. The modules I have loaded where copied from Ocaml compiler with some α-conversions to avoid messages about duplicate interfaces. What is strange is when I run a few other (dummy) commands: let Parsetree_.Pstr_eval (a,_) = ("foo" |> Lexing.from_string |> Parser_.implementation Lexer_.token_with_comments |> List.hd).pstr_desc;; let _ = Longident_.parse "foo.bar.baz";; Location_.none;; then the original command: "foo" |> Lexing.from_string |> Parser_.implementation Lexer_.token_with_comments;; is printed the expected way, i.e. without "": [{Parsetree_.pstr_desc = Parsetree_.Pstr_eval ({Parsetree_.pexp_desc = Parsetree_.Pexp_ident {Parsetree_.Asttypes.txt = Parsetree_.Longident.Lident "foo"; loc = {Parsetree_.Asttypes.Location.loc_start = {Lexing.pos_fname = ""; pos_lnum = 1; pos_bol = 0; pos_cnum = 0}; loc_end = {Lexing.pos_fname = ""; pos_lnum = 1; pos_bol = 0; pos_cnum = 3}; loc_ghost = false}}; pexp_loc = {Parsetree_.Asttypes.Location.loc_start = {Lexing.pos_fname = ""; pos_lnum = 1; pos_bol = 0; pos_cnum = 0}; loc_end = {Lexing.pos_fname = ""; pos_lnum = 1; pos_bol = 0; pos_cnum = 3}; loc_ghost = false}; pexp_attributes = []}, []); pstr_loc = {Parsetree_.Asttypes.Location.loc_start = {Lexing.pos_fname = ""; pos_lnum = 1; pos_bol = 0; pos_cnum = 0}; loc_end = {Lexing.pos_fname = ""; pos_lnum = 1; pos_bol = 0; pos_cnum = 3}; loc_ghost = false}}] Question 2: Does this make sense? Can the same value by printed by Ocaml toplevel sometimes as "" and sometimes in the ordinary fashion? Thanks in advance for the advice! Matej