Hacker News new | ask | show | jobs
by burke 3852 days ago
I haven't either, but they just start with a #, right? What's the problem?

EDIT: Oh, I see there are multiline comments.

1 comments

I see things that look a lot like english sentences that are neither preceded by #, nor surrounded by #= =#.

edit: with examples. this code, all the way up to line 48 looks like some comments, but also a bunch of sentences without the comment characters.

https://github.com/FRBNY-DSGE/DSGE.jl/blob/master/src/solve/...

I the example you link, it looks like the top half is all comments, starting with """ on a line, and ending with """ on a line. What's confusing is that code examples in the comments are surrounded by ```, and they are long enough to look like actual code.

Also, in this markup, the top comments are blue only.

Then, the actual code begins, and it is syntax-colored. In code, comments seem to be preceded by pound.

After a big chunk of code, there is another set of comments in """, and then some more code, ending with `end`.

The ``` code samples in the comments might be part of some automated comment documentation extraction standard or some markup convention. The comments near them seem very formal, defining or explaining the code.

That's the best I can do not knowing the language.

You're looking at a markdown-formatted docstring. Note that it's enclosed in """, similar to Python except that it precedes the method definition. Within the markdown formatting, you can use ``` fences to format code examples.

GitHub's coloring here doesn't quite make it as obvious as it can be. Here's how it renders at the REPL with the help system: http://imgur.com/rlAnpSK

cool. thank you.
Notice that that is between a pair of triple quotes (and github even syntax highlights it in a different color).

It's all string, more specifically a docstring (see https://en.wikipedia.org/wiki/Docstring ). They are also used in other languages, including Python.

I'm not sure how someone can clear up your confusion without a link to the specific things are you seeing.