Skip to content

Commit aab1f72

Browse files
authored
Merge pull request #126 from jasalt/doc-comment-semicolon
Semicolon and inline s-expression comments
2 parents 01a0f34 + e3247b8 commit aab1f72

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

content/documentation/basic-types.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,8 +140,20 @@ A set is a sequence of whitespace-separated values prefixed by the function `set
140140

141141
## Comments
142142

143-
A comment begins with a `#` character and continues until the end of the line. There are no multi-line comments.
143+
A comment begins with a `#` or `;` character and continues until the end of the line. There are no multi-line comments.
144144

145145
```phel
146146
# This is a comment
147+
; This is also a comment
147148
```
149+
150+
Phel also supports inline s-expression commenting with `#_` which comments out the next form. It can also be stacked to comment out two or more forms after it.
151+
152+
```
153+
[:one :two :three] # results to [:one :two :three]
154+
[#_:one :two :three] # results to [:two :three]
155+
[#_:one :two #_:three] # results to [:two]
156+
[#_#_:one :two :three] # results to [:three]
157+
```
158+
159+
See also the [comment](/documentation/api/#comment) macro which ignores the forms inside and returns `nil` while still requiring the content to be valid Phel code.

0 commit comments

Comments
 (0)