[erlang-questions] some language changes

Thomas Lindgren thomasl_erlang@REDACTED
Mon May 21 16:02:56 CEST 2007


--- Joe Armstrong <erlang@REDACTED> wrote:

> Now the book is done I've been thinking about some
> language changes.
> 
> Here's my list (no particular priority)
> 
> 1. What you type in the shell and what you type in a
> module/escript
> should be the same

If so, with macros, -include, -record and all that
gunk. I'd also recommend looking at the Prolog toploop
for a pretty good compromise.

> 2. Hashmaps (aka associative arrays)

Pure or destructive?

> 3. Extended string syntax: idea - put an atom
> *before the string quote
>     to say what the string means and to *change* the
> syntax rules that apply
>     to the string content.

This could be a good idea. How would we define such
lexer changes? User specified? (However, note that the
experience with languages with too user-mutable syntax
is not good.)

Specifying big blocks of text could be more convenient
as well.

> 4. Simple string substitutions
> 
>      X = subst "aaa ${P} bbb ${Q} ccc"
> 
>       *means*    X = [<"aaa">, P, <"bbb">, Q, ...]
> 
>      This would be very useful.

Er, did you intend 
   X = [<"aaa ">, P, <" bbb ">, Q, <" ccc">]
? :-)

Anyway, adding user-defined prefix (and infix)
operators is fairly straightforward in theory. Prolog,
SML and others have done it for ages (20-30 years).
The lexer has to detect and classify operators
properly before converting them to the proper class of
tokens.

Haskell has particularly simple infix operators,
written as 
  x `op` y
which converts to (op x y) without declarations. I
think we discussed adding that sort of thing some time
ago. It's straightforward.

Best,
Thomas

PS. And where did "!!" go?



       
____________________________________________________________________________________Pinpoint customers who are looking for what you sell. 
http://searchmarketing.yahoo.com/



More information about the erlang-questions mailing list