[erlang-questions] indentation-sensitive erlang

Ulf Wiger ulf@REDACTED
Wed Mar 19 19:28:35 CET 2008


2008/3/19, Vlad Balin <gaperton@REDACTED>:
> Can't you get rid of terminators such as 'end'?

That was my intention at first, but I ran into problems with the
grammar, and decided to keep the 'end' tokens, as well as the
ending '.' in a function definition.

BR,
Ulf W

> Anyway we have a kind
>  of two-dimentional syntax here. So you can use indentation to identify
>  scope. At the same time, we will address complains that it's hard to
>  reorder clauses in erlang because of , . and ;
>
>
>  f(X) ->
>    X+2
>
>  g(X) ->
>    X+4
>
>  h(X) ->
>    Y = case X of
>          a ->
>            {a}
>          b ->
>            {b}
>
>    Y
>
>  And that's it.
>
>  Sincerely,
>  Vlad Balin.
>
>  2008/3/19, Ulf Wiger <ulf@REDACTED>:
>
> > 2008/3/11, Ulf Wiger <ulf@REDACTED>:
>  >  >
>  >  >  - I'd like to try (= see someone else implement) an indentation-sensitive
>  >  >   front-end to the compiler,
>  >
>  >  Ok, so I did try it myself:
>  >
>  >  http://ulf.wiger.net/weblog/2008/03/19/indentation-sensitive-erlang/
>  >
>  >  (Inspired by Chris Okasaki's blog article).
>  >
>  >  Surely someone else could do a better job, but it's a start, at least.
>  >
>  >  The following senseless program compiled:
>  >
>  >  -module(test).
>  >
>  >  -compile(export_all).
>  >  -scan(indentation).
>  >
>  >  f(X) ->
>  >     X+2
>  >  .
>  >
>  >  g(X) ->
>  >     X+4
>  >  .
>  >
>  >  h(X) ->
>  >     Y = case X of
>  >           a ->
>  >             {a}
>  >           b ->
>  >             {b}
>  >     end
>  >     Y
>  >  .
>  >
>  >
>  >  BR,
>  >  Ulf W
>
> >  _______________________________________________
>  >  erlang-questions mailing list
>  >  erlang-questions@REDACTED
>  >  http://www.erlang.org/mailman/listinfo/erlang-questions
>  >
>



More information about the erlang-questions mailing list