let date()= (1998,10,30);;
module Compte = struct
class compte_bancaire = compte_avec_relevé
class type vue_du_client = object
method dépôt : float -> unit
method relevé : opération list
method retrait : float -> float
method solde : float
end
class client x : vue_du_client =
let y = if x >= 1000. then x
else raise (Failure "Apport_insuffisant") in
object (self)
inherit compte_bancaire initializer self#dépôt y end
let promotion x =
let c = new client x in
if date() < (1998,10,30) then c # dépôt 100.; c
end;;
|
|