Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions content/docs/specials.mdz
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,9 @@ macro.
The condition is considered false only if it evaluates to @code`nil` or
@code`false` - all other values are considered @code`true`.

If when-true or when-false is evaluated, this is done in the context
of a newly introduced lexical scope.

@codeblock[janet]```
(if true 10) # evaluates to 10
(if false 10) # evaluates to nil
Expand Down Expand Up @@ -211,6 +214,8 @@ or @code`nil`. Therefore, it is expected that the body will contain some side
effects or the loop will go on forever. The @code`while` loop always evaluates
to @code`nil`.

Note that the @code`while` special form introduces a new lexical scope.

@codeblock[janet]```
(var i 0)
(while (< i 10)
Expand Down
Loading