[erlang-questions] Multi-line comments in Erlang

Robert Virding robert.virding@REDACTED
Tue Dec 7 21:13:11 CET 2010


This issue comes up occasionally, but so far there has not been enough interest in it to warrant implementing it. It is not really difficult but there are some tricky issues which need solving and it is more difficult to use safely than you would imagine. I personally see no need.

Robert

----- "James Churchman" <jameschurchman@REDACTED> wrote:

> oh ok, i get what you mean. Well it can not be done with a Parse
> Transform (something i have played with a lot) unless the syntax you
> use is still valid erlang, as it wont initially parse. i imagine that
> the erlang parser itself could be very easily modified with only a few
> lines & writing your own pre-parser thing would be even easier ( <5
> LOC ? ) . Im sure this must have been mentioned a million times b4 & i
> guess it's left out as erlang is deliberately small & lean, any editor
> can handle doing multiple lines in one go & using ifdef(macro) or
> ifndef(macro) are a better way to deactivate code if thats what your
> looking for. maybe things like this inspired the language to stay
> lean. python : http://www.flickr.com/photos/nicksieger/281055485/ java
> : http://www.flickr.com/photos/nicksieger/280662707/in/photostream/
> :-)
> 
> 
> 
> On 7 Dec 2010, at 18:20, Rapsey wrote:
> 
> > Is it that important? Any proper programming editor can
> comment/uncomment
> > multiple lines.
> > 
> > 
> > Sergej
> > 
> > On Tue, Dec 7, 2010 at 5:49 PM, Zvi . <zvi.avraham@REDACTED>
> wrote:
> > 
> >> Why do you think it's not possible?
> >> It's just simple change to Erlang source code parser.
> >> Probably this should be submitted as EEP, so OTP team will consider
> it.
> >> 
> >> On Tue, Dec 7, 2010 at 6:25 PM, James Churchman
> <jameschurchman@REDACTED
> >>> wrote:
> >> 
> >>> not posible in erlang, but many editors (eg i use textmate) will
> comment
> >>> and uncomment multiple lines with % on each line..
> >>> On 7 Dec 2010, at 15:32, Zvi wrote:
> >>> 
> >>>> Hi,
> >>>> 
> >>>> Matlab/Octave has single line comments, like Erlang (i.e.
> starting
> >>>> with '%' sign). But it also have multi-line comments, like for
> >>>> example:
> >>>> 
> >>>> %{
> >>>> this is example
> >>>> of multi-line
> >>>> comments in Matlab
> >>>> %}
> >>>> 
> >>>> which is equivalent to:
> >>>> 
> >>>> %this is example
> >>>> %of multi-line
> >>>> %comments in Matlab
> >>>> 
> >>>> How difficult is to add comments like this to Erlang?
> >>>> 
> >>>> Thanks,
> >>>> Zvi
> >>>> 
> >>>> ________________________________________________________________
> >>>> 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