[erlang-questions] file:script/1 and -include

Ulf Wiger ulf@REDACTED
Sat Apr 14 11:51:18 CEST 2007


-include(...) is a preprocessor directive. The function file:script()
expects a sequence of expressions - just like file:eval(), btw,
except it returns the value of the last expression, rather than just
'ok'.

I'm not aware of any library function that does what you want.

BR,
Ulf W


2007/4/14, Peter Steiner <pst@REDACTED>:
>
> hi,
>
>
> using -include in a file evaluated with file:script/1 fails with the
> error message:
>
> {undef,[{erl_eval,include,1},{erl_eval,expr,3}]}
>
> the evaluated file is:
>
>
>        1 -include("defs.hrl").
>        2
>        3 [
>        4 ].
>
>
> does the error indicate that -include not available for file:script/1
> evaluated code? if so, is there a function like file:script that
> evaluates a string instead of file content?
>
>
> thanks for any hints!
>
> regards,
> peter.
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://www.erlang.org/mailman/listinfo/erlang-questions
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20070414/d1c1de12/attachment.htm>


More information about the erlang-questions mailing list