caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Christophe Garion <tofgarion@runbox.com>
To: caml-list@inria.fr
Subject: [Caml-list] Printer for lists in toplevel is different when opening List
Date: Wed, 26 Feb 2020 16:30:32 +0100	[thread overview]
Message-ID: <877e09fjs7.fsf@port-garion.isae.fr> (raw)

Hello,

I am using OCaml 4.09.0 from OPAM and I have just noticed something
peculiar using the toplevel.

When evaluating 1 :: 2 :: [], the list is printed as usual:

# 1 :: 2 :: 3 :: [] ;;
- : int list = [1; 2; 3]

If I open first List, then the printing is different:

# open List ;;
# 1 :: 2 :: 3 :: [] ;;
- : int List.t = (::) (1, [2; 3])

The list is now typed with the type t used in the List module signature
and the list representation is different. It seems that the "classic"
printing function is used for the tail of the list, but not for the
first Cons of the list.

Is it normal?

Best regards,

Christophe

--
Christophe Garion
GPG: 1982 15B2 64AC 3C34 532D  BF19 6CD6 246C 62DA 5A7F

             reply	other threads:[~2020-02-26 15:30 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-26 15:30 Christophe Garion [this message]
2020-02-26 15:51 ` Nicolás Ojeda Bär
2020-02-26 20:55   ` Christophe Garion
2020-02-26 18:36 ` Florian Angeletti
2020-02-26 21:00   ` Christophe Garion

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=877e09fjs7.fsf@port-garion.isae.fr \
    --to=tofgarion@runbox.com \
    --cc=caml-list@inria.fr \
    /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;
as well as URLs for NNTP newsgroup(s).