discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

use of comments in code

JA
joe a
Sat, Apr 2, 2022 5:07 PM

I need some clarification on the use of "comments" markers in code.

As I understand it (quote marks for "clarity") "//" will treat the rest
of the line as a comment.

"/* blah-blah */"  treats everything enclosed as comment, or, ignores
everything so enclosed.

In openscad items I have obtained, partly for training purposes to learn
by observation so to speak, by commenting out sections of code to
observe effects (and attempt to customize).

I some there are sections of code like this:

"// */ bunch o'code // */" (not necessarily on one line).

Not sure what to make of that.  Could it just be an authors idiosyncrasy?

If acceptable, I can post a screen clip of the code section to help clarify.

I need some clarification on the use of "comments" markers in code. As I understand it (quote marks for "clarity") "//" will treat the rest of the line as a comment. "/* blah-blah */" treats everything enclosed as comment, or, ignores everything so enclosed. In openscad items I have obtained, partly for training purposes to learn by observation so to speak, by commenting out sections of code to observe effects (and attempt to customize). I some there are sections of code like this: "// */ bunch o'code // */" (not necessarily on one line). Not sure what to make of that. Could it just be an authors idiosyncrasy? If acceptable, I can post a screen clip of the code section to help clarify.
TP
Torsten Paul
Sat, Apr 2, 2022 5:15 PM

On 02.04.22 19:07, joe a wrote:

"// */ bunch o'code // */" (not necessarily on one line).

Partially guessing without seeing the actual code...

If it's on one line, it's a comment due to the beginning //

If it's on multiple lines, it can be used to "comment out the
comment markers"

// /*
a number
of code
lines
// */

Would be enabled with the // present, but disabled due to
the multi-line comment when // is removed.

It seems to be an unnecessary complicated way of doing things,
but maybe some sort of "works-in-other-languages" case.

ciao,
Torsten.

On 02.04.22 19:07, joe a wrote: > "// */ bunch o'code // */" (not necessarily on one line). Partially guessing without seeing the actual code... If it's on one line, it's a comment due to the beginning // If it's on multiple lines, it can be used to "comment out the comment markers" // /* a number of code lines // */ Would be enabled with the // present, but disabled due to the multi-line comment when // is removed. It seems to be an unnecessary complicated way of doing things, but maybe some sort of "works-in-other-languages" case. ciao, Torsten.
JA
joe a
Sat, Apr 2, 2022 6:10 PM

On 4/2/2022 1:15 PM, Torsten Paul wrote:

On 02.04.22 19:07, joe a wrote:

"// */ bunch o'code // */" (not necessarily on one line).

Partially guessing without seeing the actual code...

If it's on one line, it's a comment due to the beginning //

If it's on multiple lines, it can be used to "comment out the
comment markers"

// /*
a number
of code
lines
// */

Would be enabled with the // present, but disabled due to
the multi-line comment when // is removed.

It seems to be an unnecessary complicated way of doing things,
but maybe some sort of "works-in-other-languages" case.

ciao,
  Torsten.


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org

That's kinda what I thought at first.  But then I noticed that the the
"start" is like this "// /" rather than like this "// /"  (asterisk
location different).

Trying to "uncomment" those sections leads to "syntax errors" that do
not yield to my efforts to discover them.

I've dropped a message to the author on thingiverse.com.  Maybe that
will provide me a clue.

On 4/2/2022 1:15 PM, Torsten Paul wrote: > On 02.04.22 19:07, joe a wrote: >> "// */ bunch o'code // */" (not necessarily on one line). > > Partially guessing without seeing the actual code... > > If it's on one line, it's a comment due to the beginning // > > If it's on multiple lines, it can be used to "comment out the > comment markers" > > // /* > a number > of code > lines > // */ > > Would be enabled with the // present, but disabled due to > the multi-line comment when // is removed. > > It seems to be an unnecessary complicated way of doing things, > but maybe some sort of "works-in-other-languages" case. > > ciao, >   Torsten. > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org That's kinda what I thought at first. But then I noticed that the the "start" is like this "// */" rather than like this "// /*" (asterisk location different). Trying to "uncomment" those sections leads to "syntax errors" that do not yield to my efforts to discover them. I've dropped a message to the author on thingiverse.com. Maybe that will provide me a clue.