[erlang-questions] My biggest beef with Erlang
Joe Armstrong
erlang@REDACTED
Tue Nov 27 09:52:01 CET 2007
Now you mentioned receive it occurred to me that it would be rather nice to
receive a fun in Erlang. Unfortunately receive has only one syntactic form
receive
pattern1 -> action1;
...
end.
In the spirit of funs it would be very nice to say:
F = fun(Pattern1) -> Actions1
(Pattern2) -> Actions2
after Time -> Actions
end,
...
receive(Fun)
This would make writing an erlang meta interpreter much easier
and allow all kinds of mischief
/Joe Armstrong
On Nov 27, 2007 12:06 AM, Christian S <chsu79@REDACTED> wrote:
> 2007/11/26, Robert Virding <rvirding@REDACTED>:
> > or how about:
> > (: mod func arg1 arg2 ... )
> > for all cases?
>
> It seems like (? ...) and (! ...) are the chosen ways for receive and
> send, and (: M F A...) has a nice symmetry with that. That's a thumbs
> up. (However, I find that too many one-character symbols to make code
> be a bit "naked", I'm a fast enough typist that I dont mind spelling
> out full words and I think it makes code more readable in the end.)
>
> My initial feeling was that ':' would only be a reader macro, that
> there would be a full form for remote calls, just like how '(a b c) is
> shorthand for (quote (a b c)).
>
> As far as I understand, lisp started out being a theoretical model
> used to describe/reason about programs, until someone figured out it
> would be easy to make a computer evaluate them. It would probably be a
> sensible route to start erlang in sexprs too: write some programs,
> discover the needed features, then try to build an evaluator for it.
>
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://www.erlang.org/mailman/listinfo/erlang-questions
>
More information about the erlang-questions
mailing list