Browse thread
[Caml-list] lisp -> ocaml
[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
| Date: | -- (:) |
| From: | Chris Hecker <checker@d...> |
| Subject: | Re: [Caml-list] lisp -> ocaml |
>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