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

Re: Truthfulness of physical equality of empty lists

Expand Messages
  • Sylvain Le Gall
    Hello, ... 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
    Message 1 of 5 , Mar 1, 2011
    • 0 Attachment
      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
      --
      My company: http://www.ocamlcore.com
      Linkedin: http://fr.linkedin.com/in/sylvainlegall
      Start an OCaml project here: http://forge.ocamlcore.org
      OCaml blogs: http://planet.ocamlcore.org
    • Lukasz Stafiniak
      ... http://caml.inria.fr/pub/docs/manual-ocaml/manual032.html#toc138 Empty lists are the integer 0.
      Message 2 of 5 , Mar 1, 2011
      • 0 Attachment
        On Tue, Mar 1, 2011 at 4:21 AM, Arlen Cuss <celtic@...> wrote:
        >
        >
        >
        > Hi all,
        >
        > 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?

        http://caml.inria.fr/pub/docs/manual-ocaml/manual032.html#toc138

        Empty lists are the integer 0.
      • Arlen Cuss
        ... Thanks a bunch! Cheers, A [Non-text portions of this message have been removed]
        Message 3 of 5 , Mar 1, 2011
        • 0 Attachment
          On Tue, 2011-03-01 at 11:23 +0100, Lukasz Stafiniak wrote:
          > On Tue, Mar 1, 2011 at 4:21 AM, Arlen Cuss <celtic@...> wrote:
          > >
          > >
          > >
          > > Hi all,
          > >
          > > 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?
          >
          > http://caml.inria.fr/pub/docs/manual-ocaml/manual032.html#toc138
          >
          > Empty lists are the integer 0.

          Thanks a bunch!

          Cheers,
          A


          [Non-text portions of this message have been removed]
        • Arlen Cuss
          ... Thanks! I knew there was something like this I was missing. Cheers, Arlen [Non-text portions of this message have been removed]
          Message 4 of 5 , 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]
          Your message has been successfully submitted and would be delivered to recipients shortly.