Loading ...
Sorry, an error occurred while loading the content.

12506Re: "ocaml_beginners"::[] Re: Truthfulness of physical equality of empty lists

Expand Messages
  • Arlen Cuss
    Mar 1, 2011
    • 0 Attachment
      On Tue, 2011-03-01 at 09:19 +0000, Sylvain Le Gall wrote:
      > Hello,
      >
      > On 01-03-2011, Arlen Cuss <celtic@...> wrote:
      > >
      > > I've gone temporarily dumb, as I swear I've seen a reference for why
      > > empty lists should always be physically equal ([] == []), but can't seem
      > > to find it any more.
      > >
      > > Is anyone able to educate me or provide a link as to how come this
      > > happens?
      > >
      >
      > The empty list is an immediate value [] -> Val_int(0).
      > http://caml.inria.fr/pub/docs/manual-ocaml/manual032.html#toc138
      > (18.3.4)
      >
      > So it is just like if you compare two unboxed integers (i.e. 0 == 0).
      >
      > Cheers,
      > Sylvain Le Gall

      Thanks! I knew there was something like this I was missing.

      Cheers,
      Arlen


      [Non-text portions of this message have been removed]
    • Show all 5 messages in this topic