Mirror of the Rel4tion website/wiki source, view at <http://rel4tion.org>

[[ 🗃 ^yEzqv rel4tion-wiki ]] :: [📥 Inbox] [📤 Outbox] [🐤 Followers] [🤝 Collaborators] [🛠 Commits]

Clone

HTTPS: git clone https://vervis.peers.community/repos/yEzqv

SSH: git clone USERNAME@vervis.peers.community:yEzqv

Branches

Tags

master :: projects / idan / manual / 01-intro /

05-comments.mdwn

[[!meta title=“1.5 | Comments”]]

Comments

Comments are parts of Idan code that are discarded by the parser, at least for statement construction purposes. They are there only for humans to read.

There are two kinds of comments, referred here as “single line comments” (SLCs) and “multi line comments” (MLCs). The naming isn’t accurate because an MLC can be on a single line. But an MLC can stretch over more than one line, while an SLC can’t.

An SLC can start anywhere on a line, and strenches from that point until the end of the line. A double hyphen (--) marks the beginning of a SLC. Example:

-- This is a commment.
<%> smaoin:is_a smaoin:Property -- This is a another comment.

An MLC has a start marker and an end marker, and can therefore begin and end anywhere. It begins with {- and ends with -}. Examples:

{- This is a comment. -} {- This is another comment. -}
{- Comment too. -} <%> smaoin:is_a smaoin:Property -- This is an SLC.
{- Multi line comment starts here.
    line 2
    line 3 -}
<%> {- 1 -} smaoin:is_a {- 2 -} myns:Person
{- hello world
 - this is a comment line
 - this is still the same comment
 - that's right, still inside the comment
 - one more line for fun...
 - and we're done.
 -}

An MLC may contain MLCs inside it, which allows commenting out text which itself contains comments. The inner MLCs can recursively contain MLCs themselves. MLCs can be nested this way to unlimited depth. For example, the following is a valid MLC:

{- <%> {- {- 1 -} -} smaoin:is_a {- {- 2 -} -} myns:Person -}
[See repo JSON]