[erlang-questions] Comments in Config Files (i.e. file:consult/1)

Ulf Wiger ulf.wiger@REDACTED
Sun Feb 21 18:18:26 CET 2010

Jayson Vantuyl wrote:
> I use file:consult/1 to load in some configuration.  It seems that,
> as far as I can tell, that it handles comments (using %) just fine.
> However, I don't see this in the docs anywhere.  Is this intended
> behavior?  Is it guaranteed not to change?  Should I add it to the
> docs?

It is sort of implied... All functions that operate on text
and convert to erlang terms (the shell, io:read, file:consult,
file:eval, file:script, etc.) all rely on the erlang tokenizer
and parser, which handle whitespace and comments.

It would be a lot of extra work, and highly undesireable, to
introduce a term parser that does /not/ handle comments, and
from experience I know that some large projects mandate comments
(such as e.g. copyright blurbs) in input files for file:consult.

So don't worry about it changing in the future, and I agree that
the documentation could be a bit less terse on this subject. :)

Ulf W
Ulf Wiger
CTO, Erlang Solutions Ltd, formerly Erlang Training & Consulting Ltd



Since January 1st 2010 Erlang Training and Consulting Ltd. has become ERLANG SOLUTIONS LTD.


More information about the erlang-questions mailing list