Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] Single-case union types as strong typedefs
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Nathaniel Gray <n8gray@g...>
Subject: Re: [Caml-list] Single-case union types as strong typedefs
On Sat, 23 Oct 2004 14:24:28 -0700, Nathaniel Gray <n8gray@gmail.com> wrote:
> On Sat, 23 Oct 2004 12:31:39 +0900 (JST), Jacques Garrigue
> <garrigue@kurims.kyoto-u.ac.jp> wrote:
> 
> > Unlucky!
> > With your example, there is no extra boxing involved.
> > I.e. (1,3) and Rpos(1,3) and Apos(1,3) all share the same physical
> > representation (a block with 2 fields).
> > The problem you describe only occurs when your single constructor has
> > only one argument.
> 
> Really??  You're kidding.  That's kind of cool but kind of strange --
> why does it only optimize for composite types?

Never mind.  After thinking about it for a minute I understand -- it's
not an optimization, it's just the normal physical representation. 
That's what I get for changing my example at the last minute --
originally it was inches vs. centimeters.  :-)

Cheers,
-n8

-- 
>>>-- Nathaniel Gray -- Caltech Computer Science ------>
>>>-- Mojave Project -- http://mojave.cs.caltech.edu -->

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners