Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: Steffen Smolka <smolka@cs.cornell.edu>
To: Caml List <caml-list@inria.fr>
Subject: [Caml-list] private object constructor?
Date: Mon, 13 Feb 2017 13:23:21 -0500	[thread overview]
Message-ID: <CAGh2ivAncBJ9_je1YhV17XjcniXJG2W63E5ay4ba9wKFemk87w@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 285 bytes --]

Hi,

Is it possible to expose an object or class type in OCaml without exposing
the constructor, i.e. the ability to construct objects of the type? OCaml
supports private ADTs and type synonyms, but the private keyword doesn't
seem to work with classes or objects.

Thanks,
-- Steffen

[-- Attachment #2: Type: text/html, Size: 369 bytes --]

             reply	other threads:[~2017-02-13 18:23 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-13 18:23 Steffen Smolka [this message]
2017-02-13 18:57 ` Ivan Gotovchits
2017-02-13 19:11   ` Steffen Smolka

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=CAGh2ivAncBJ9_je1YhV17XjcniXJG2W63E5ay4ba9wKFemk87w@mail.gmail.com \
    --to=smolka@cs.cornell.edu \
    --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