[erlang-questions] Re: Multi-line comments in Erlang

Banibrata Dutta banibrata.dutta@REDACTED
Thu Dec 9 18:55:36 CET 2010


On Thu, Dec 9, 2010 at 11:20 PM, Zvi <zvi.avraham@REDACTED> wrote:

> I think Python using '#' for comments.
>

Single line comments start with '#', but multi-line is done using """..."""


>
> On Dec 9, 5:58 pm, Daniel Goertzen <daniel.goert...@REDACTED> wrote:
> > Thank you for reminding me about HEREDOCs.  In Python, I often use triple
> > quoted strings for multiline comments.  It works well, but they are
> exposed
> > to the interpreter which smells a bit.  What if erlang had HEREDOCs
> *plus* a
> > way to mark any string as a comment.  Some illustrations, using Python's
> > triple quoting as HEREDOC format.
> >
> > X="""
> > This is
> > a multiline heredoc
> > """,
> > ...
> >
> > %"""
> > This is
> > a multiline comment
> > """
> >
> > myfun(X, Y %"An inline comment", Z) -> ...
> >
> > So comment and string delimiting uses the exact same logic, but you stick
> a
> > % in front to mark it as a comment instead of a string.
> >
> > Dan.
> >
> >
>


More information about the erlang-questions mailing list