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: 2002-10-24 (19:40)
From: Basile STARYNKEVITCH <basile@s...>
Subject: Re: [Caml-list] Again on pattern matching and strings
>>>>> "Daniel" == Daniel de Rauglaudre <> writes:

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

    >> What about "DEFINE" / "UNDEF"?

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

Some thoughts on these macro issues.

1. I think it is extremly important to add the ability to have 
    expression macros
    pattern macros
    compile time flags (ifdef) for conditional compilation
   inside the same source file (also containing usual Ocaml code,
    perhaps using these extensions).

2.  There are cases where variadic macros could be useful. I know it is
     tricky to implement them.

3.  If it make Daniel's life easier, having different keywords to
    define expression macros, pattern macros, flags, could be ok, eg

4. mixing macros and flags is important in my opinion. I mean that in
   C it is usual to code

   #ifdef WANT_DEBUG
   #define DEBUGME(V) if (debugflag) printf("%d", V)
   #define DEBUGME(V) {}

   I really would like compile flags & macros to be also mixable in

5. having the equivalent of __FILE__ and __LINE__ is very useful

Above all, I really appreciate Camlp4 and do hope it will continue to



email: basile<at>starynkevitch<dot>net 
alias: basile<at>tunes<dot>org 
8, rue de la Faïencerie, 92340 Bourg La Reine, France
To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: