[erlang-questions] Core erlang definition
Richard Carlsson
carlsson.richard@REDACTED
Thu Mar 16 22:59:34 CET 2017
The Core Erlang home page is still up:
https://www.it.uu.se/research/group/hipe/cerl/
Caveat: the spec has not been updated with the changes for bitstrings and
maps. Would be nice to do that some day...
The optimal way to represent literals tends to vary between passes, so
there's never a clear-cut choice. If you use the cerl.erl module, you'll
find some utility functions like fold_literal/1 and unfold_literal/1,
is_literal_term/1, etc., that can take care of the details. For example,
cons_hd/1 and cons_tl/1 will give you the head subtree even if the argument
is a literal list.
/Richard
2017-03-16 17:32 GMT+01:00 Robert Virding <rvirding@REDACTED>:
> Does there exist a current definition ofCore Erlang? I know you can look
> in cerl.erl to see which constructions exist but there is a lot which is
> unclear on how they are to be used. For example one problem I had was HOW
> to represent literals. They can either be done by having them literally
> (haha) inside a #c_lit{} record or as a whole nested tree of Core records.
> I noticed that even if these are in principle equivalent sometimes later
> passes of the compile required one or the other to work.
>
> I got it working in the LFE compiler but it feels a bit risky not to be
> certain why it works, and what might happen if I change things.
>
> Robert
>
>
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20170316/228c1a3a/attachment.htm>
More information about the erlang-questions
mailing list