[erlang-questions] variable argument preprocessor macros

Robert Virding <>
Wed Jan 14 03:40:34 CET 2009


No. The only thing you can do is have is to have:

    SIMPLE_SERVER_DEBUG_2("mesg-1", "mesg-2")
and
    SIMPLE_SERVER_DEUBG_4("mesg-1", "mesg-2", mesg-3, mesg-4)

Which is generally not a problem for you.

An alternative would be to use LFE which has proper lisp and scheme macros.
If you like writing in lisp. :-)

Robert

2009/1/14 Anupam Kapoor <>

> hi all,
>
> is there a way to define a variable argument macro in erlang ?
> something like '...' (elipsis) stuff in C ? i tried to look for the
> information, but could not really find anything pertinent.
>
> for example, i would like to be able to say:
>       SIMPLE_SERVER_DEBUG("mesg-1", "mesg-2") in one place,
> and in some other place
>       SIMPLE_SERVER_DEUBG("mesg-1", "mesg-2", mesg-3, mesg-4)
> etc etc
>
> i have just started dabbling in the language, so please be gentle :o)
>
> kind regards
> anupam
> --
> In the beginning was the lambda, and the lambda was with Emacs, and
> Emacs was the lambda.
> _______________________________________________
> erlang-questions mailing list
> 
> http://www.erlang.org/mailman/listinfo/erlang-questions
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20090114/623338ed/attachment.html>


More information about the erlang-questions mailing list