Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
[Caml-list] my first questions about camlp4
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2003-05-22 (17:16)
From: Basile STARYNKEVITCH <basile@s...>
Subject: Re: [Caml-list] my first questions about camlp4
>>>>> "Ed" == Ed L Cashin <> writes:

    Ed> "Dont Bother" <> writes:
    >> 1. It's been said that Camlp4 is not as easy to use as Lisp
    >> macros, but is it as powerful? Is there anything that can be
    >> done with Lisp macros that can not be done using Camlp4 in the
    >> context of their respective languages?

    Ed> You might get a better answer to that question on
    Ed> comp.lang.lisp. [...]

I do know a tiny bit CL, and I do practice Ocaml with Camlp4. It seems
to me that CommonLisp macros can -for example- interact with CL object
system, while Camlp4 is purely syntactic (in that sense, it is more
like Scheme macros). For example, I tend to believe that you can make
a commonlisp macro which, given a class name C, extract all the fields
F of this class C such that F name ends with a suffix S and generate a
printing routine which prints only those fields. I think that this is
not possible in Camlp4 (unless you redefine in Camlp4 the syntax
defining Ocaml classes).

In a more general way, I do think that Ocaml still lacks some
reflective abilities (which could help for other things,
e.g. persistency).

Also, macros are an essential part of CommonLisp; for example, they
are repeatedly used for CommonLisp advocacy, while Camlp4 is not yet
used systematically by Ocaml believers.


email: basile<at>starynkevitch<dot>net 
aliases: basile<at>tunes<dot>org = bstarynk<at>nerim<dot>net
8, rue de la Faïencerie, 92340 Bourg La Reine, France

To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: