Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: "Matej Košík" <mail@matej-kosik.net>
To: "Nicolás Ojeda Bär" <nicolas.ojeda.bar@lexifi.com>
Cc: OCaml Mailing List <caml-list@inria.fr>
Subject: Re: [Caml-list] a question about Ocaml toplevel behavior
Date: Sun, 11 Mar 2018 16:51:20 +0100	[thread overview]
Message-ID: <81818a99-0a21-f5b3-8708-7a4c99d13935@matej-kosik.net> (raw)
In-Reply-To: <CADK7aFNB617x3CS2BFd44=kfD4-Jp8903vcZotducBHrkrBqBQ@mail.gmail.com>

Hi Nicolás,

Thank you for the reply.

On 03/11/18 16:06, Nicolás Ojeda Bär wrote:
> Hello Matej,
> 
> My understanding is that the compiler will delay opening a .cmi file
> until absolutely necessary.> Since it does not need to look into Location in order to compile the
> given phrase, the .cmi is not opened and the type Location.t remains
> abstract. But if you give the compiler an excuse to open location.cmi
> then the definition of the type Location.t will become known to the
> compiler and the toplevel will be able to print the values concretely.
I see some of the disadvantages of this behavior:

  (0) I have lost time wondering why things are printed as "<abstr>" instead of the real thing.

  (1) "<abstr>" may (confusingly) mean something else than "a value of an abstract type".
      It may mean that "toplevel has find an excuse not to load a relevant *.cmi file some so it does not know (yet) how to print a given value.
      (this is very unintuitive)

  (2) #install_printer directive may have no effect if toplevel has find an excuse not to load relevant *.cmi file.
      (this is very unintuitive)

Was this done on purpose? What do we gain from this behavior?
(considering that computer time (as opposed to human time) has ~zero value).

  reply	other threads:[~2018-03-11 15:51 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-10 17:55 Matej Košík
2018-03-11 13:30 ` Matej Košík
2018-03-11 15:06   ` Nicolás Ojeda Bär
2018-03-11 15:51     ` Matej Košík [this message]
2018-03-11 19:17       ` Nicolás Ojeda Bär
2018-03-12  8:44         ` Matej Košík
2018-03-12  8:50     ` Jacques Garrigue
2018-03-12  9:09       ` Matej Košík

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=81818a99-0a21-f5b3-8708-7a4c99d13935@matej-kosik.net \
    --to=mail@matej-kosik.net \
    --cc=caml-list@inria.fr \
    --cc=nicolas.ojeda.bar@lexifi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox