Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: Georges Brun-Cottan <gbruncot@emc.com>
To: caml-list@inria.fr
Subject: [Caml-list] equality over functional value
Date: Fri, 20 Apr 2001 16:12:14 -0400 (EDT)	[thread overview]
Message-ID: <200104202012.QAA09326@lub0127.lss.emc.com> (raw)


Hi, 

A friend of mine is just starting with ocaml. He was puzzled by the
following result:

# let a i = i;;
val a : 'a -> 'a = <fun>
# let b i = i;;
val b : 'a -> 'a = <fun>
# a=b;;
Uncaught exception: Invalid_argument "equal: functional value".
# a=a;;
- : bool = true
# 

That is 'a=a' does not return the expected exception.  Actually it
first hit this "curiosity" when creating a polymorphic 'sort' function
on lists - and by applying it to a [sort;sort..] list. It worked.

Is this a bug? 

It might means that some errors can came up detected later than any
Camel rider would have expected...


[Francais]

Bonjour, 

Un ami débute en ocaml. Il fut intrigué par le résultat suivant:

# let a i = i;;
val a : 'a -> 'a = <fun>
# let b i = i;;
val b : 'a -> 'a = <fun>
# a=b;;
Uncaught exception: Invalid_argument "equal: functional value".
# a=a;;
- : bool = true
# 

a=a ne retourne pas l'exception attendue. 

Est-ce un bogue? 

Je suis un peu inquiet à l'idée que certaines erreurs de programmation
grossière peuvent être ainsi être détectés trop tardivement.

-- Georges
-------------------
To unsubscribe, mail caml-list-request@inria.fr.  Archives: http://caml.inria.fr


             reply	other threads:[~2001-04-20 20:12 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-04-20 20:12 Georges Brun-Cottan [this message]
2001-04-20 21:23 ` Alain Frisch
2001-04-21 11:32   ` Marcin 'Qrczak' Kowalczyk
2001-04-21 15:24 ` David Monniaux
2001-04-23  7:01 ` Jean-Christophe Filliatre
2001-04-23  7:56 ` Xavier Leroy
2001-04-23 14:04   ` Alain Frisch
2001-04-24  7:13   ` Fabrice Le Fessant

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=200104202012.QAA09326@lub0127.lss.emc.com \
    --to=gbruncot@emc.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