[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
| Date: | -- (:) |
| From: | Jean-Christophe Filliatre <Jean-Christophe.Filliatre@l...> |
| Subject: | Re: [Caml-list] re: help with ocaml |
Bauer, Robert writes:
>
> Also, I find that if try to use any capitalized variables, I get interesting
> errors - for
> example if I try let XYZ_ZYX = (false, false);; I get an error, whereas let
> xyz_zyx = (false, false);;
> works just fine. Or more simply, let XYZ = (false, false);; fails. Again, I
> am hoping for an explanation.
Ocaml distinguishes between capitalized and uncapitalized identifiers.
The former are used for constructors, exceptions and modules, and the
latter for other kinds (values, types, etc.)
This helps avoiding trivial mistakes, like mispelling the name of a
constructor (which would therefore be understood as a variable). It
also helps when reading third-party code, since you can easily
discriminate between constructors and functions in an application, for
instance.
There is a page of ocaml reference manual about names:
http://caml.inria.fr/ocaml/htmlman/manual010.html
Sincerely,
--
Jean-Christophe Filliatre
mailto:Jean-Christophe.Filliatre@lri.fr
http://www.lri.fr/~filliatr
-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr