24Fermer26
SallyLe 11/02/2004 à 09:00
Hippohmu :
Et ça?

let a x y = y x in
let b x y = x y a in
let c x y = x b y in
let d x y = x y c in
let e x y = x d y in
let f x y = x y e in f;;

- : ('a -> (((('e -> (((('i -> ('k -> ('k -> 'l) -> 'l) -> 'j) -> 'i -> 'j) -> 'g -> 'h) -> 'g -> 'h) -> 'f) -> 'e -> 'f) -> 'c -> 'd) -> 'c -> 'd) -> 'b) -> 'a -> 'b = <fun>
chapo
Kevin > je ne vois pas le rapport avec ta remarque précédente, mais c'est effectivement une des innombrables différences entre le caml et le C : si tu veux pouvoir modifier une variable, il faut utiliser une référence ou un champ mutable d'une structure.