Why is there no multiline comment support in Erlang?

After a short Google search, Erlang doesn't seem to support multiline comments, is that really so?

And if so, why?

I know that some editors support region comments (adding% first to each line of the region), but I really don't want to choose an editor based on this.

+5
source share
2 answers

Erlang has no multi-line comments.

In general, I did not find that this is very important: I use templates for gen_server and supervisor and a common template for other modules, and all of them include locks of the top block. I get support for some templates from my editor (Emacs), but you can be an editing agent and just write some templates and copy them to any new modules you want.

The biggest use of multi-line comments other than documentation is to comment out a large piece of code. Since your Erlang code should usually be small, you can simply comment on the function call, which is a one-line comment.

+3
source

It's simple. Use preprocessor:

-ifdef(comment). Something to comment You can add text or function(Declaration) -> ... Which will removed from file -endif. 
+5
source

Source: https://habr.com/ru/post/1200386/


All Articles