caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] Printer for lists in toplevel is different when opening List
@ 2020-02-26 15:30 Christophe Garion
  2020-02-26 15:51 ` Nicolás Ojeda Bär
  2020-02-26 18:36 ` Florian Angeletti
  0 siblings, 2 replies; 5+ messages in thread
From: Christophe Garion @ 2020-02-26 15:30 UTC (permalink / raw)
  To: caml-list

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

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

end of thread, other threads:[~2020-02-26 21:01 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-26 15:30 [Caml-list] Printer for lists in toplevel is different when opening List Christophe Garion
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

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).