[erlang-questions] A small question about macros

Ivan Uemlianin ivan@REDACTED
Thu May 16 09:41:05 CEST 2013


Dear Martin

If by commands you mean function names, you can have spaces in functions 
names.  In erlang a function name is just an atom.  If you want spaces 
in an atom you enclose it in single quotes:

   MyAtom = 'this atom is fine'.

Example module:

   -module('te st').
   -export(['do this'/0]).

   'do this'() ->
       'Ol Korekt!'.

Usage:

   1> c('te st').
   {ok,'te st'}
   2> 'te st':'do this'().
   'Ol Korekt!'

:D

Ivan


On 16/05/2013 05:04, Martin Hedberg wrote:
>
>
> Hi there
>
> Have begun to take my first "baby steps" with Erlang (holding on to
> books and tutorials).
> I read about how to make macros in the language. However I wonder how I
> do if I want
> to have blank spaces in my commands? So I just can write, for example:
> "repeat 5 times".
>
> Hope you don't see me as a heretic if I want to HyperTalk-ificat Erlang
> a little bit. :-)
>
> I am very grateful for any help.
>
> Best regards
>
> Martin
>
>
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions
>

-- 
============================================================
Ivan A. Uemlianin PhD
Llaisdy
Speech Technology Research and Development

                     ivan@REDACTED
                      www.llaisdy.com
                          llaisdy.wordpress.com
               github.com/llaisdy
                      www.linkedin.com/in/ivanuemlianin

                         festina lente
============================================================



More information about the erlang-questions mailing list