block comments

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

block comments

Lloyd R. Prentice

Hello,
 
Since it hasn't been done I'd guess a compiler constraint.
 
But why doesn't Erlang have a method for commenting out a block of lines in a module without
having to tag every line with %?
 
Or did I miss that page?
 
It would be so convenient  at times.
 
Thanks,
 
LRP
 
 
 
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20140717/d0069dd9/attachment.html>

Reply | Threaded
Open this post in threaded view
|

block comments

Richard A. O'Keefe

On 18/07/2014, at 12:11 PM, <lloyd> wrote:
> But why doesn't Erlang have a method for commenting out a block of lines in a module without
> having to tag every line with %?

See the Ada rationale.
>  
> Or did I miss that page?
>  
> It would be so convenient  at times.

In my text editor, writing Prolog, I can comment out
a region in one of two ways:

<visit beginning>               <visit beginning>
<mark>                          <mark>
<visit end>                     <visit end>
Meta-/                          Meta-%

It's the same number of keystrokes to get /**/ around
or % on every line.



Reply | Threaded
Open this post in threaded view
|

Re: block comments

Mike Oxford
In reply to this post by Lloyd R. Prentice
In emacs, mark the region (<ctrl>-space, move to the other end) and then C-c-C-c (Ctrl-C twice) to comment out and then C-c-C-u to uncomment.

I dislike /* */ because you cannot nest them.  I like per-line, though I will admit to abusing ifdefs in C/C++ in a past life.

-mox



On Thu, Jul 17, 2014 at 5:11 PM, <[hidden email]> wrote:

Hello,

 

Since it hasn't been done I'd guess a compiler constraint.

 

But why doesn't Erlang have a method for commenting out a block of lines in a module without

having to tag every line with %?

 

Or did I miss that page?

 

It would be so convenient  at times.

 

Thanks,

 

LRP

 

 

 

 


_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions



_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|

Re: block comments

PAILLEAU Eric
In reply to this post by Lloyd R. Prentice
Hi,

Using vi :

Comment :
Esc :x,ys/^/%/g

Uncomment :
Esc :x,ys/^%//g

Where x=starting line number, y= ending line number


regards

_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|

Re: block comments

PAILLEAU Eric
Hi,

I remember a mail about Here Documents in Erlang, and found it :

http://erlang.org/pipermail/erlang-questions/2010-December/055118.html

MHO This would be a good idea for many uses, including multiline comments.

For instance, I personnally embed perldocs in bash scripts into Here
documents.
The documentation is in scripts, human readable, follows versionning of
the code, and man pages are created with pod2man.

http://bahut.alma.ch/2007/08/embedding-documentation-in-shell-script_16.html

Enjoy.
Regards
_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions