Browse thread
[Caml-list] Again on pattern matching and strings
[
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: | Basile STARYNKEVITCH <basile@s...> |
| Subject: | Re: [Caml-list] Again on pattern matching and strings |
>>>>> "Daniel" == Daniel de Rauglaudre <daniel.de_rauglaudre@inria.fr> 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
DEFEXPRMACRO DEFPATTERNMACRO
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)
#else
#define DEBUGME(V) {}
#endif
I really would like compile flags & macros to be also mixable in
Ocaml
5. having the equivalent of __FILE__ and __LINE__ is very useful
Above all, I really appreciate Camlp4 and do hope it will continue to
grow!
Regards.
--
Basile STARYNKEVITCH http://starynkevitch.net/Basile/
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 caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners