English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
[Caml-list] revised syntax and immediate objects
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2006-07-04 (23:07)
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".