Hash :
d41f2661
Author :
Thomas de Grivel
Date :
2025-05-18T20:36:15
fix doc nav and links
A KC3 do block is a source code block. It starts with do or { and
ends with end or } respectively.
It can be passed to a special operator or macro function to
be evaluated explicitly in C with env_eval_do_block (see
libkc3/env_eval.c).
A block evaluates all its instructions in turn, and returns the value of the last expression.
ikc3> do
ikc3> 1
ikc3> 2
ikc3> 3
ikc3> end
3
ikc3> quote do
ikc3> 1
ikc3> 2
ikc3> 3
ikc3> end
do
1
2
3
end
ikc3> type(quote do
ikc3> 1
ikc3> 2
ikc3> 3
ikc3> end)
Block
Top : KC3 documentation
Previous : 1.02 Array
Next : 1.04 Bool
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
# 1.3 Do block
A KC3 **do** block is a source code block. It starts with `do` or `{` and
ends with `end` or `}` respectively.
It can be passed to a special operator or macro function to
be evaluated explicitly in C with `env_eval_do_block` (see
`libkc3/env_eval.c`).
A block evaluates all its instructions in turn, and returns the value
of the last expression.
## 1.3.1 Examples
```elixir
ikc3> do
ikc3> 1
ikc3> 2
ikc3> 3
ikc3> end
3
ikc3> quote do
ikc3> 1
ikc3> 2
ikc3> 3
ikc3> end
do
1
2
3
end
ikc3> type(quote do
ikc3> 1
ikc3> 2
ikc3> 3
ikc3> end)
Block
```
---
Top : [KC3 documentation](../)
Previous : [1.02 Array](1.02_Array)
Next : [1.04 Bool](1.04_Bool)