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

Gordon Guthrie gordon@REDACTED
Sun Feb 21 18:28:55 CET 2010

Jason wrote:
>> I use file:consult/1 to load in some configuration.

Don't forget to add the magic line at the start of your config files:

which means that when you open them in emacs erlang-mode kicks in and
they indent/colourise correctly :)


On 21 February 2010 17:18, Ulf Wiger <ulf.wiger@REDACTED> wrote:
> 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. :)
> BR,
> Ulf W
> --
> Ulf Wiger
> CTO, Erlang Solutions Ltd, formerly Erlang Training & Consulting Ltd
> http://www.erlang-solutions.com
> ---------------------------------------------------
> ---------------------------------------------------
> Since January 1st 2010 Erlang Training and Consulting Ltd. has become ERLANG
> www.erlang-solutions.com
> ________________________________________________________________
> erlang-questions (at) erlang.org mailing list.
> See http://www.erlang.org/faq.html
> To unsubscribe; mailto:erlang-questions-unsubscribe@REDACTED

More information about the erlang-questions mailing list