[erlang-questions] "-define" in lfe?
Tue Dec 16 22:42:33 CET 2008
As yet there are symbol macros in lfe, i.e. you cannot do the same as with
-define() and define an atom to expand into an expression as for example:
-define(foo, "foo bar").
As yet you can only define macro forms:
(defmacro foo () '"foo bar")
which you would call by (foo). Note that you can use macros anywhere, even
in patterns. If being able to define symbol macros is important for you I
will consider adding them.
There are two sets of defining macros in LFE: an older scheme inspired set
which is not supported any more and will be phased out; and a newer CL
inspired set. The CL based set does include a scheme inspired syntax-rule
macro definer, called defsyntax, as this is practical for simple expansion
The User Guide describes (briefly) the CL inspired defining macro set.
2008/12/16 Raoul Duke <raould@REDACTED>
> lfe seems to be quite rich when it comes to macro forms; might anybody
> know which one should i use to duplicate erl-style "-define()"? i
> tried (define (foo1 "foo2")) and some variations but get
> thank you.
> erlang-questions mailing list
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the erlang-questions