Browse thread
Re: [Caml-list] OCaml wishlist
[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
| Date: | -- (:) |
| From: | samsaga2 <samsaga2@s...> |
| Subject: | Re: [Caml-list] OCaml wishlist -> my wish |
It could be well that:
let hello name = Printf.printf "Hello %s\n" name in
let nooverride hello number = Printf.printf "You're only a number
%d!!\n" number in
hello "samsaga2";
hello 666
And the output will be:
Hello samsaga2
You're only a number 666!!
nooverride label it's optional
Then functions as (+) and (+.) could be:
let (+) number1 number2 = number1 + number2 in
let nooverride (+) number1 number2 = number1 +. number2
even
type vector3 = { x : float; y : float; z : float }
let nooverride (+) v1 v2 = { x = v1.x + v2.x; y = v1.y + v2.y; z =
v1.z + v2.z }
But... it's only a wish :-P
-------------------
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