Version française
Home     About     Download     Resources     Contact us    
Browse thread
default arguments in classes
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Paolo Donadeo <p.donadeo@g...>
Subject: Re: [Caml-list] default arguments in classes
This should work:

# class foo =
  object
    method bar =
      let helper a b ?(c = "") () =
        Printf.printf "a = %d; b = %b; c = %s\n" a b c in
        helper
  end;;
class foo : object method bar : int -> bool -> ?c:string -> unit -> unit end

Any undesired side effects?


-- 
Paolo
~
~
:wq