* (In)Equality type specialization
@ 2008-08-08 10:57 Christophe TROESTLER
0 siblings, 0 replies; only message in thread
From: Christophe TROESTLER @ 2008-08-08 10:57 UTC (permalink / raw)
To: OCaml Mailing List
Hi,
Is a declaration like
external float_eq : float -> float -> bool = "%equal"
considered to be an acceptable way to specialize equality? Type
annotations do not work in my case because it may be that one passes
[float_eq] as a function argument before evaluating it. I could of
course define
let float_eq (x:float) y = x = y
but it is slightly less efficient.
So my question is whether I can expect the external declaration to be
robust enough to keep working in future versions of OCaml or whether I
should prefer the second (safe) solution which OCaml compilers will
eventually optimize.
Regards,
C.
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2008-08-08 10:57 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-08-08 10:57 (In)Equality type specialization Christophe TROESTLER
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox