Version française
Home     About     Download     Resources     Contact us    
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: -- (:)
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
   \__/       qrczak@knm.org.pl
    ^^     http://qrnik.knm.org.pl/~qrczak/

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