Browse thread
[Caml-list] revised syntax and immediate objects
-
Jonathan Roewen
- Martin Jambon
-
Matt Gushee
- Jonathan Roewen
- Nicolas Pouillard
- Nicolas Pouillard
[
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: | Jonathan Roewen <jonathan.roewen@g...> |
| Subject: | Re: [Caml-list] revised syntax and immediate objects |
> > I'd like to try make a camlp4 syntax extension that uses immediate
> > objects,
>
> I've done that. I'll show you the key section of the code below, and I
> can send you the complete file if you like. It may not be 100% correct,
> but I've been using it in an application and so far it works. I don't
> know if I can *explain* it, though ... I wrote it several months ago,
> and I'm coming to think that CamlP4, like Perl, is a write-only language ;-)
Hmm, I'm getting an error trying to use class_str_item (ocaml 3.09.2):
# #use "topfind";;
# #camlp4o;;
# #require "camlp4.extend";;
# open Pcaml;;
# let gen_method loc field =
let obj = "obj" in
<:class_str_item< method $lid:field$ = $lid:obj$#$lid:field$; >>;;
Unbound quotation: "class_str_item";;
(The rhs of the expression is temporary, just for testing)
Also, I similarly get similar error for "class_expr".