Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What do /+ and +/ indicate in D?

Tags:

comments

d

In some of the Derelict source code, I see some blocks that are surrounded by /+ and +/, like so:

/+ other
alias FTC_MruNodeRec*       FTC_MruNode;
alias FTC_MruListRec*       FTC_MruList;
alias FTC_MruListClassRec*  FTC_MruListClass;
+/

(Just an example, of course.) What are these? They look like comments, but the content looks like valid code. I'm not able to find anything on Google due to /+ not being a useful search string. Any help?

like image 659
Mark LeMoine Avatar asked Jun 13 '11 22:06

Mark LeMoine


2 Answers

They are comments, just like /* and */ in C/C++. The different is that /+ and +/ nest, while the other versions do not.

For example, this entire line is a comment.

/+ A /+ B +/ C +/

But with /* */, the C and closing */ is uncommented:

/* A /* B */ C */

/+ +/ helps a lot when you need to comment out large blocks of code.

like image 121
Peter Alexander Avatar answered Nov 08 '22 09:11

Peter Alexander


They're the same as /* and */, but they can be nested, e.g.:

/+ These are /+ all +/ commented +/
like image 32
user541686 Avatar answered Nov 08 '22 10:11

user541686