From: Hendrik Tews <tews@tcs.inf.tu-dresden.de>
To: caml-list@inria.fr
Subject: grammar for class types
Date: Fri, 14 May 1999 18:59:37 +0200 [thread overview]
Message-ID: <199905141659.SAA07446@ithif20.inf.tu-dresden.de> (raw)
Hi,
when I tried to define some classes and class types I came across
the following questions:
1. What is the difference between
# class type b = [int, string] a;;
and
# type c = (int, string) a;;
assuming some class type a with two type parameters?
And Why do I have to use different parentheses in both cases?
(Yes, I know, it's what the manual says, but I would expect that
one kind of parentheses should be enough for all kind of type
parameters. )
2. Why is it not possible to add type constraints to the first
kind of type abbreviation, like in
class type ['a] c = ['a, string] a constraint 'a = int;;
3. (To re-raise a question from John Prevost which has never been
addressed:) Why is it not possible to mix type definitions and
class type definitions like in
# class type a = object method m : a end
# and
# type b = Node of a | Tree of b * b
(Yes, it is possible to use the < ... > notation, but it is not
possible to use # with such types.)
Bye,
Hendrik
reply other threads:[~1999-05-15 14:17 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=199905141659.SAA07446@ithif20.inf.tu-dresden.de \
--to=tews@tcs.inf.tu-dresden.de \
--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