Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: John Goerzen <jgoerzen@complete.org>
To: caml-list@inria.fr
Subject: [Caml-list] Optional arguments in inherited methods
Date: Wed, 28 Apr 2004 11:13:36 -0500	[thread overview]
Message-ID: <20040428161336.GA3286@excelhustler.com> (raw)

Hello,

I have this defined in a base class:

    method private getdata sname oname =  <code here>

In my subclass, I wish to do this:

    method private getdata ?(raw=false) ?(idepth=10) ?extravars sname oname = <code>

The compiler does not seem to like this at all, though I am at a loss to
explain why.  Can someone help me out?

The error I get is:

The method getdata has type
  ?raw:'a -> ?idepth:'b -> ?extravars:'c -> 'd -> 'e -> 'f
  but is expected to have type string -> string -> string

So even stranger is that it doesn't set a type for anything, even though
it has enough information to figure out the type for everything.

Hints?

-- John

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


             reply	other threads:[~2004-04-28 16:13 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-04-28 16:13 John Goerzen [this message]
2004-04-28 16:56 ` james woodyatt
2004-04-28 19:43   ` John Goerzen
2004-04-28 22:48     ` Jacques GARRIGUE
2004-04-29  8:11       ` Henri DF
2004-04-29  8:48         ` Jacques GARRIGUE

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=20040428161336.GA3286@excelhustler.com \
    --to=jgoerzen@complete.org \
    --cc=caml-list@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