[erlang-questions] some language changes

Christian S chsu79@REDACTED
Wed May 23 22:38:28 CEST 2007


On 5/23/07, Ulf Wiger (TN/EAB) <ulf.wiger@REDACTED> wrote:
> 1> md("
> -module(foo).
> ...
> plus(A,B) -> A+B.
> ").
> {module, foo}

Isnt this horribly annoying when you have string litterals in the
module you are defining?
How about following the idea from unix shells:

cat <<EOF
dobido
blah...
sim salabim
EOF

Where EOF can be any other string (that wont occur in the body). I
dont understand why ml9 doesnt use this concept. How about using the
module name plus a dot as the module  terminating line?

1> -module(foo).
>-export([plus/2]).
>
>plus(A, B) -> A + B.
>
>foo.
{ok, foo}
2>

(Not a "screenshot", just mockup.)

It would make it easier to put some example code in <PRE></PRE> that
the newbie can
cut'n'paste into the erl they just installed with apt-get install
erlang. And then have them start using the fresly defined module.

For symmetry the compiler would probably want to ignore an atom and
'.' so there wont be a problem that modules that work in the shell are
refused when compiling them from .erl files.
:)



More information about the erlang-questions mailing list