English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
[Caml-list] :: operator not quotable using ( ... )
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2002-04-25 (08:52)
From: John Prevost <visigoth@c...>
Subject: Re: [Caml-list] :: operator not quotable using ( ... )
>>>>> "rv" == Remi VANICAT <vanicat@labri.u-bordeaux.fr> writes:

    rv> cons is not really an operator, it's a constructor

    >>  let cons x y = x :: y

    rv> the same hold for any constructor :

Ahh, I had forgotten, thanks.  It might be good, then, to cause (::)
to return the same kind of error as a constructor does, instead of:

# Cons;;
The constructor Cons expects 2 argument(s),
but is here applied to 0 argument(s)
# (::);;
Syntax error

At the very least, this will remind people what the real problem is.
Making constructors usable as functions might be desirable, but I'm
okay with not having it as long as we have good error messages.  :)

To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners