mirror of
https://github.com/urbit/developers.urbit.org.git
synced 2024-09-11 13:55:59 +03:00
Hotfix Hoon School
This commit is contained in:
parent
9fc20104f0
commit
0c08e489c0
@ -227,12 +227,12 @@ How can we control what kind of value a gate returns? Many programming language
|
|||||||
Remember `^-` kethep? We will use `^-` as a _fence_, a way of making sure only data matching the appropriate structure get passed on.
|
Remember `^-` kethep? We will use `^-` as a _fence_, a way of making sure only data matching the appropriate structure get passed on.
|
||||||
|
|
||||||
```hoon {% copy=true %}
|
```hoon {% copy=true %}
|
||||||
:: Confirm whether a value is greater than one.
|
:: Confirm whether a value is greater than one by return 1 (if no) or 0 (if yes).
|
||||||
|= a=@ud
|
|= a=@ud
|
||||||
^- @ud
|
^- @ud
|
||||||
?: (gth a 1)
|
?: (gth a 1)
|
||||||
%.n
|
1
|
||||||
%.y
|
0
|
||||||
```
|
```
|
||||||
|
|
||||||
**This is the correct way to define a gate.** Frequent annotation of type with `^-` kethep fences is _essential_ to producing good Hoon code. From this point forward in Hoon School, we will hew to this standard.
|
**This is the correct way to define a gate.** Frequent annotation of type with `^-` kethep fences is _essential_ to producing good Hoon code. From this point forward in Hoon School, we will hew to this standard.
|
||||||
|
Loading…
Reference in New Issue
Block a user