Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] Looking for a real array
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Brian Hurt <brian.hurt@q...>
Subject: Re: [Caml-list] Looking for a real array
On Mon, 28 Apr 2003, Eray Ozkural wrote:

> On Monday 28 April 2003 21:43, Brian Hurt wrote:
> > I may be confused, but I thought integers were unboxed in arrays (not
> > BigArrays, just arrays).  Unless you mean references to integers?
> >
> 
> Okay, I might be a little confused, forgive me. I thought, implementation 
> wise, when I say
> let a = [| 6, 3, 5, 7, 8 |]

Start with, I think you meant [| 6; 3; 5; 7; 8 |].  Notice the semicolons.  
I say this only because I've been caught on this several times before :-}.

> it's implemented by ocaml as
> int** a;
> in C speak.

I thought ints were always unboxed.  They fit into a word.  That's why 
they're 31 bits, not 32 bits- the low bit is a tag so the GC can 
differentiate pointers from ints.

Hopefully someone who can speak authoritiatively will speak up.

Brian


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