Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] enums in OCaml?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Francisco Valverde Albacete <fva@t...>
Subject: Re: [Caml-list] enums in OCaml?
Hi there,

I wouldn't like to be patronising in this, so please forgive if I don't use as many
emoticons as I should be doing... ;)

leary@nwlink.com wrote:

> So, what's so wrong with just using variables?
>
> let Accel = 1;;
> let Stop = 0;;
>
> seems pretty short to write and shortest to use...  Am I missing something
> ( elegant | obvious )?  Is that just ugly?

I gather you are learning the language... If it is because you want to try
something new or want to check some of the publicised "good" qualities of FP, why
don't you try to code your type in *both* styles, one using constants and the other
sum types and then make a better-informed decision?

As long as you are at it, also, why not make it into a tutorial for the coding of
such types? We seem to be short on tutorials in Ocaml...

Regards, and best of luck... I hope you see the light (and start coding in Ocaml!
:) )

        Francisco Valverde
        Univ. Carlos III de Madrid


-------------------
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