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
246 constructors?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2007-05-06 (22:16)
From: Tom <tom.primozic@g...>
Subject: Re: [Caml-list] 246 constructors?
I think a better and simpler (and probably faster as well) solution would be
to simply use an extra "tag word" for all constructors of the "large-tag
type". It could even probably be implemented using camlp4 extenstion
(turning all "large-tag types" into records with an implicit first word
indicating the tag, and then transforming the pattern matching of these
values to pattern matching of records. To simplify things, you could even
use a special annotation for such blocks (for the camlp4 version only, of

- Tom

On 06/05/07, Brian Hurt <bhurt@spnz.org> wrote:
> I think a better solution, although I have no idea how difficult it'd be
> to implement, would be "large tag blocks".  For blocks with large tag
> values (say, >245), the tag value in the tag word would be the special
> "large tag" tag (say, value 246), and the last word of the block would be
> the "large" tag value.  I say last, as this means you can still get the
> nth word of a block without needing to special case large blocks.  This
> would allow a full word to be used for tag values (giving way more than
> enough tag values), and wouldn't change either memory usage or code for
> blocks with small tag values.