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] Again on pattern matching and strings
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Daniel de Rauglaudre <daniel.de_rauglaudre@i...>
Subject: Re: [Caml-list] Again on pattern matching and strings

On Thu, Oct 24, 2002 at 11:50:46AM +0200, Stefano Zacchiroli wrote:

> What about "DEFINE" / "UNDEF"?

There is already a Camlp4 syntax extension "pa_ifdef.cmo" which adds
"define" and "ifdef" (in lowercases). This is more for conditional

In C macros, you have the two system with the same #define directive:
   #define FOO
   #define FOO(x) (...)

The first form suggests that you are going to do a conditional compilation
somewhere with #ifdef or #ifndef (and you can do it also in the command
line by -DFOO: the pa_ifdef.cmo Camlp4 extension adds also this option

The second form suggests that you are going to do a macro substitution.

Is is a good idea to follow the same idea in Camlp4 macros?
I.e. having one construction for both cases? I don't know.
I think it is possible, but perhaps a little bit tricky.
Does anybody have an opinion?

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