caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: "Hongbo Zhang (BLOOMBERG/ 731 LEX)" <hzhang295@bloomberg.net>
To: caml-list@inria.fr
Subject: [Caml-list] question: what is the recommended use case of `val` in class type
Date: Sat, 2 Jul 2016 16:45:58 -0000	[thread overview]
Message-ID: <5777EFC6021303B200390026_0_980@p057> (raw)

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

Dear all,
    I have a question about val in class type, is it only useful in inheritance?
    for example
   
    class type text = object val mutable text : string end      
   
    let f (x : text ) = x#text;;                                                                                                                                                               
                      ^                                                                                                                                                                      
Error: This expression has type text                                                                                                                                                         
       It has no method text   
    Thanks -- Hongbo

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

             reply	other threads:[~2016-07-02 16:46 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-02 16:45 Hongbo Zhang (BLOOMBERG/ 731 LEX) [this message]
2016-07-02 16:59 ` Gabriel Scherer
2016-07-02 17:02 Hongbo Zhang (BLOOMBERG/ 731 LEX)
2016-07-02 17:07 ` Nicolas Ojeda Bar
2016-07-02 17:23 Hongbo Zhang (BLOOMBERG/ 731 LEX)
2016-07-03  6:23 ` Jacques Garrigue
2016-07-04 10:19   ` Goswin von Brederlow
2016-07-04 21:56     ` Jacques Garrigue
2016-07-05 13:00 Hongbo Zhang (BLOOMBERG/ 731 LEX)

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=5777EFC6021303B200390026_0_980@p057 \
    --to=hzhang295@bloomberg.net \
    --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;
as well as URLs for NNTP newsgroup(s).