Re: Question about O'Caml 3

From: Jacques Garrigue (garrigue@kurims.kyoto-u.ac.jp)
Date: Fri Apr 28 2000 - 02:52:38 MET DST

  • Next message: Jacques Garrigue: "Re: hashtables for mutable records"

    From: Thorsten Ohl <ohl@hep.tu-darmstadt.de>

    > Contrary to the documentation, O'Caml 3.00 accepts, lowercase
    > identifiers for polymorphic variants.
    >
    > ohl@heplix4:~Mail$ ocaml
    > Objective Caml version 3.00
    >
    > # `foo;;
    > - : [> `foo] = `foo
    >
    > Who's right: the compiler or the manual?

    Well, we were so busy discussing label syntax that this point was not
    debated before 3.00.
    The current answer is: both are correct.

    If you want to be on the safe side, better not to use lowercase
    variants, since they could be removed in the future.
    Also they are probably not so nice if you are really intending to use
    them as sum types, which are usually identified by their uppecase
    first letter.
    On the other hand, I have a personal liking for lowercase variants, at
    least when they have only an abstract meaning (not really used as
    values, but rather as types, and types are lowercase).

    Some libraries, namely lablGL and lablGTK (only internally for
    lalblGTK), actually use lowercase labels, so I prefered to keep them
    for now in the compiler, as they are not harmful, rather than having
    to correct everything before a real decision is taken.

    ---------------------------------------------------------------------------
    Jacques Garrigue Kyoto University garrigue at kurims.kyoto-u.ac.jp
                    <A HREF=http://wwwfun.kurims.kyoto-u.ac.jp/~garrigue/>JG</A>



    This archive was generated by hypermail 2b29 : Fri Apr 28 2000 - 12:10:07 MET DST