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] Suggestion for Int32.rotate
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2002-02-06 (20:39)
From: Frederic van der Plancke <fvdp@d...>
Subject: Re: [Caml-list] Suggestion for Int32.rotate
Daniel de Rauglaudre wrote:
> Hi,
> On Wed, Feb 06, 2002 at 07:01:51PM +0100, Xavier Leroy wrote:
> > A C-style syntax would be 12345L for int32 and 123456789LL for
> > int64; what about nativeint?  12345N ?  Anything nicer?

A small problem of 12345L is that "L" for "long" is not justified on
64-bit platforms, and more importantly it is not at all obvious what
length it actually represents.

What about 12345i32, 123456789i64, like some C(++) compilers do; that would
preserve extensibility (in case one wants 123456789i128 in the future),
and makes the value types clearer and more consistent,
even though it makes the actual values somewhat less readable, specially
if one uses an uppercase I. ('N' or (why not) 'L' could be used instead.)
For native ints we could then chose either 12345i or 12345n. And keep
the other one for arbitrary-sized integers.

Just my €0.02 worth of suggestions... I can live with L and LL.

Frédéric vdP

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