[erlang-questions] Adding new operators?
Wed Apr 10 16:41:41 CEST 2013
You should be able to do that with a parse_transform/2. Look up parse
transform: you basically get to implement a function which the compiler
calls at compilation time passing it a formal representation of the source
code it's compiling (a.k.a abstract forms... though I'm not entirely sure
about the terminology).
You can then use the erl_syntax module to manipulate these forms.
On 8 April 2013 08:21, Anthony Ramine <n.oxyde@REDACTED> wrote:
> Hello David,
> A fancy way to extend the Erlang syntax would be to have something like
> Camlp4, a powerful and extensible preprocessor for OCaml. It has a powerful
> quotation system which it itself uses to implements its parser construct,
> to extend OCaml's syntax at compile-time. I have began writing a quotation
> system for Erlang but didn't have the time finish it yet .
>  https://github.com/nox/otp/tree/brackets
> Anthony Ramine
> Le 8 avr. 2013 à 02:12, David Goehrig <dave@REDACTED> a écrit :
> > Next step is integrating into the stack better. But the question
> remains, what is the best way to add a new operator.
> erlang-questions mailing list
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the erlang-questions