[erlang-questions] Core Erlang questions

Lars-Åke Fredlund lfredlund@REDACTED
Thu Oct 16 09:51:26 CEST 2008


Hello,

I am considering using Core Erlang to do some transformations on Erlang 
code, that is doing transformations on the result of after compiling 
"to_core", and so would like to have a very small and regular source 
language as a starting point.

 From reading the Core Erlang 1.0.3 language specification it seems that
it is impossible to have expressions with "complex subexpressions" (a 
very nice syntactic property!)

For example,
   the tuple
           {2, receive <X> when 'true' -> X after 'infinity' -> 'true'}
   would not be legal Core Erlang since the receive (like any other 
expression)
   returns a sequence, not a value. And because it is not a value,
  such a sequence cannot be "spliced" into a tuple (except via an outer 
let expression):

 let <_cor1> =
           receive
             <X> when 'true' ->
                 X
           after 'infinity' ->
             'true'
       in
           {2,_cor1}


Is this a correct understanding of the dynamic semantics? (or is a 
singleton sequence also a value?)

How should one then understand the "2" in the tuple, doesn't this 
expression also return a sequence?
(just nitpicking)


/Lars-Ake Fredlund







More information about the erlang-questions mailing list