Précédent Suivant Index



Déclarations


#let une_constante = 1;;
une_constante : int = 1
#let une_constante = 3.4 in 
   une_constante+.1.2;;
- : float = 4.6
#let carré = function x -> x*x;;
carré : int -> int = <fun>
#let carré (x) = x*x;;
carré : int -> int = <fun>
#let carré x = x*x;;
carré : int -> int = <fun>
#carré (25);;
- : int = 625
#carré 36;;
- : int = 1296
#let rec fact = function n ->
   if n <= 0 then 1 else n*fact(n-1);;
fact : int -> int = <fun>
#let une_variable = ref true;;
une_variable : bool ref = ref true
#une_variable := false;;
- : unit = ()
#une_variable;;
- : bool ref = ref false
#une_constante := 5;;
Entrée interactive:
>une_constante := 5;;
>^^^^^^^^^^^^^
Cette expression est de type int,
mais est utilisée avec le type 'a ref.
#prefix := ;;
- : 'a ref -> 'a -> unit = <fun>

Précédent Suivant Index