[erlang-questions] Newbie question: function include/1 undefined

Richard A. O'Keefe ok@REDACTED
Mon Oct 3 01:26:46 CEST 2016

On 1/10/16 2:25 AM, Donald Steven wrote:
> Hi all,
> I can get '-include(' to work before the main() function, but I can't
> get it to work *in* a function, either using a comma or a period at end.

The syntax of Erlang does not allow this.
An Erlang source file is a sequence of chunks each terminated by
a full stop.
A chunk is a function definition if it does not begin with "-";
if it does begin with "-" it's a declaration like -module or
-export or a preprocessor directive like -include.

These things *cannot* be mixed.

Can you tell us what you are trying to achieve by doing this?

More information about the erlang-questions mailing list