Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
[Caml-list] Obj.magic, Obj.t etc.
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2003-08-15 (10:52)
From: Marcin 'Qrczak' Kowalczyk <qrczak@k...>
Subject: Re: [Caml-list] Obj.magic, Obj.t etc.
Dnia pią 15. sierpnia 2003 12:32, skaller napisał:

> > But now the check is required before polymorphic access. It happens in
> > inner loops in almost all functions from the Array module.
> Then you lift the check out of the loop:
> one check, two loops specialised for each case.

It's not me who inserts the check, it's the OCaml compiler. Lifting it out 
of loops and of recursive functions like Array.to_list and Array.of_list 
would have to be done by the compiler.

IMHO a separate float_array type would be better. The main problem is that 
it would need a different syntax for element access and separate versions 
of Array functions. You couldn't use the same code polymorphically for int 
and float arrays, but we don't have polymorphic arithmetic anyway...

I wonder if it's improved when generics are adopted.

   __("<         Marcin Kowalczyk

To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: