Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: Goswin von Brederlow <goswin-v-b@web.de>
To: caml-list@inria.fr
Subject: Re: [Caml-list] Object Features
Date: Mon, 8 Dec 2014 10:35:31 +0100	[thread overview]
Message-ID: <20141208093531.GB25411@frosties> (raw)
In-Reply-To: <CAAxsn=F54CpGmqUCD=hxp9=bPv5jLuGkpb8YyKPX4qjMUMuoEA@mail.gmail.com>

On Mon, Dec 01, 2014 at 09:49:32AM +0000, Jeremy Yallop wrote:
> On 30 November 2014 at 04:24, Jordan W <jordojw@gmail.com> wrote:
> > I understand that object punning on "functional updates" to objects was
> > recently added to trunk. This is a nice consistency, but I haven't found a
> > way to perform object punning on methods or values for object *expressions*.
> >
> >     let x = 10
> >     let y = 20
> >     let o = object
> >       method x
> >       method y
> >     end
> 
> I wonder how far it's wise to take this idea.  It would be possible to
> extend the approach to a lot of places where it's currently necessary
> to write 'x = x'.  For example, we could extend module-level bindings
> similarly:
> 
>    module (F : sig
>                  val x : int
>                  val y : int
>                end) =
>    struct
>      open F
>      let x
>      let y
>    end

struct
  include F
end

MfG
	Goswin

  reply	other threads:[~2014-12-08  9:35 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-30  4:24 Jordan W
2014-11-30 13:45 ` Philippe Wang
2014-12-08  9:34   ` Goswin von Brederlow
2014-12-08 10:06     ` Gabriel Scherer
2014-11-30 15:49 ` Gerd Stolpmann
2014-12-01 10:09   ` Alain Frisch
2014-12-26 23:45     ` Jordo
2014-12-01  9:49 ` Jeremy Yallop
2014-12-08  9:35   ` Goswin von Brederlow [this message]
2014-11-30 15:53 Damien Guichard

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=20141208093531.GB25411@frosties \
    --to=goswin-v-b@web.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