caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Chris Hecker <checker@d6.com>
To: Xavier Leroy <Xavier.Leroy@inria.fr>
Cc: Miles Egan <miles@caddr.com>, caml-list@inria.fr
Subject: Re: [Caml-list] lisp -> ocaml
Date: Mon, 28 May 2001 12:02:01 -0700	[thread overview]
Message-ID: <4.3.2.7.2.20010528111151.026ca2a0@shell16.ba.best.com> (raw)
In-Reply-To: <20010528153256.C21783@pauillac.inria.fr>


>reflected in the type of atoms.  Of course, to preserve type safety,
>property keys need to be typed, so that when we recover a data from a
>property list, its type is known.

Yeah, this was the part that I was missing (that you needed to have the preallocated property around to pass in).

So, in lisp, I assume I don't need to pass in this other piece of data since it's dynamically typed.

However, with this, it seems like I need to pass in the same property instance to "get" that I gave to "put" (so that the closure sets the right thing), so if I want somebody else to be able to get the properties I set, then I have to pass them all my property instances as well, right?  Which sort of causes the same heterogeneity problem again.  ;)  Or am I missing something?

I guess you could preallocate properties for the basic types in the atoms.mli file so everybody could use them, but you'd still have to have a set that your app uses for your own types.

Still, it's definitely a cute trick!

Somebody needs to make a website with "wacky but potentially useful functional patterns", since there's no way I'd have thought of this, or combinators, or whatever.  :)

Chris

-------------------
To unsubscribe, mail caml-list-request@inria.fr.  Archives: http://caml.inria.fr


      reply	other threads:[~2001-05-28 19:10 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-05-22 16:33 Miles Egan
2001-05-22 16:52 ` Markus Mottl
2001-05-22 17:09 ` Brian Rogoff
2001-05-22 18:27 ` Remi VANICAT
2001-05-22 17:12   ` Miles Egan
2001-05-22 18:26     ` Chris Hecker
2001-05-27 13:01 ` Xavier Leroy
2001-05-27 14:43   ` Miles Egan
2001-05-27 21:24   ` Dave Mason
2001-05-28 17:10     ` William Chesters
2001-05-28  0:06   ` Chris Hecker
2001-05-28 13:32     ` Xavier Leroy
2001-05-28 19:02       ` Chris Hecker [this message]

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=4.3.2.7.2.20010528111151.026ca2a0@shell16.ba.best.com \
    --to=checker@d6.com \
    --cc=Xavier.Leroy@inria.fr \
    --cc=caml-list@inria.fr \
    --cc=miles@caddr.com \
    /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).