Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] Bug? Printf, %X and negative numbers
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Ville-Pertti Keinonen <will@e...>
Subject: Re: [Caml-list] Bug? Printf, %X and negative numbers
> need to do a signed or unsigned int conversion.  Or, I suppose, we 
> could
> completely redesign Ocaml to use 32-bit ints and do something else to
> differentiate ints from pointers :-).

That would only require a redesign of part of the runtime.  As far as I 
can tell, at least for native code, it should only affect the 
representation of mixed data, garbage collection and use in polymorphic 
functions, none of which would necessarily be that bad for performance 
if designed and optimized properly.

On the other hand, the efficiency of the current implementation 
probably has a lot to do with good choices of compromises in allocating 
the bits of block headers...

I wonder how much work it would be to test how efficiently such a 
change could be done without going all the way...has anyone looked into 
this?

> More pragmatically, I think this behavior should just be documented.
> "Broken as designed".  Once you know about it, it's annoying not 
> critical.

And maybe %u should be disabled altogether if it can never produce any 
correct results that differ from %d.

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