aboutsummaryrefslogtreecommitdiff
path: root/docs/functions.md
diff options
context:
space:
mode:
Diffstat (limited to 'docs/functions.md')
-rw-r--r--docs/functions.md6
1 files changed, 3 insertions, 3 deletions
diff --git a/docs/functions.md b/docs/functions.md
index 05d84e4a..5ea2decd 100644
--- a/docs/functions.md
+++ b/docs/functions.md
@@ -86,10 +86,10 @@ add_cache := @{:add_args:Int}
func add(x, y:Int -> Int):
args := add_args(x, y)
- if add_cache:has(args):
- return add_cache:get(args)
+ if cached := add_cache[args]:
+ return cached
ret := _add(x, y)
- add_cache:set(args, ret)
+ add_cache[args] = ret
return ret
```