Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: Paolo Donadeo <p.donadeo@gmail.com>
To: OCaml mailing list <caml-list@yquem.inria.fr>
Subject: Re: [Caml-list] default arguments in classes
Date: Wed, 17 Jun 2009 00:06:10 +0200	[thread overview]
Message-ID: <4b5157c30906161506n33c55504w3ef5d327249b9b52@mail.gmail.com> (raw)
In-Reply-To: <f74178430906161412u6d60f8c2m80dd90f02b57aa7d@mail.gmail.com>

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


  reply	other threads:[~2009-06-16 22:06 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-16 21:12 Jacques Le Normand
2009-06-16 22:06 ` Paolo Donadeo [this message]
2009-06-16 22:34 ` [Caml-list] " Martin Jambon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4b5157c30906161506n33c55504w3ef5d327249b9b52@mail.gmail.com \
    --to=p.donadeo@gmail.com \
    --cc=caml-list@yquem.inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox