Dear ocamlers,
Christophe Raffalli a écrit:
Here is a list of request for Ocaml that would really make the librayand
for formal and numerical calculus better (see
http://www.raffalli.univ-savoie.fr/~RAFFALLI/formel.html) :- include with ...
- include in structure.would be great.
- Infix operator like + ...I would like that too.
R.+ should be an infix operator and R.(+) would be prefix.
One could event think to reuse symbols like + for many functions.I fear that your share proposal will not interact well with separate compiling of modules:
Here is a simple proposal on how to do it that I would really enjoy to
see working :Two new commands in OCaml structure (the syntax can be changed):
share + : 'a -> 'a -> 'a
this makes that + exists and is type-checked with type 'a -> 'a -> 'a
share + = add_int
share + = add_float
...
One could even allow some kind of recursive macros !This, I think, is inspired by C++ templates and specialisation issues;share + = fun (x,y) (x',y') -> (x+x', y+y')
share + = List.map2 (+)
share + = Array.map2 (+)This is a bit mode difficult to implement, but it seems feasible.
Maybe there is anyhow a way to find a strict, satisfying meaning to share.
Does somebody have insights ?
Cheers.
Thierry Bravier