Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: Olivier Chararas <charar_o@cnam.fr>
To: caml-list@inria.fr
Subject: OCAML parametric class coercion
Date: Sun, 30 May 1999 22:24:35 +0200	[thread overview]
Message-ID: <37519E82.7D14@cnam.fr> (raw)

(*
NAIVE REQUEST :
In this design the ellipsis won't be bound so I wanted to use coercion
but I can't figure out how to express the coercion with respect to
the parametric type.

Can you help me on syntax?
Or is the problem more fundamental?
Is this bad design anyway?

Thanks
*)

# class ['a] truc(init,(dev:'a)) =
  object(self)
   method essai = 1
  end
  ;;
class ['a] truc : 'b * 'a -> object method essai : int end
# 
  class ['a] bidu1((dev:'a)) =
  object(self)
   method rate(untruc) = untruc#essai
  end
  ;;
Some type variables are unbound in this type:
  class ['a] bidu1 : 'a -> object method rate : < essai : 'b; .. > -> 'b
end
The method rate has type < essai : 'a; .. > -> 'a where .. is unbound
# 
  class ['a] bidu2((dev:'a)) =
  object(self)
   method rate(untruc:truc) = untruc#essai
  end
  ;;
The type constructor truc expects 1 argument(s),
but is here applied to 0 argument(s)




             reply	other threads:[~1999-05-31  9:49 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-05-30 20:24 Olivier Chararas [this message]
1999-05-31 10:57 ` Sylvain BOULM'E
1999-06-01  4:44 ` Benoit deBoursetty

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=37519E82.7D14@cnam.fr \
    --to=charar_o@cnam.fr \
    --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