fix
This commit is contained in:
parent
b7d9e8e55d
commit
405cc23b3d
|
|
@ -1,6 +1,6 @@
|
||||||
; Closure example: counter function that captures state
|
; Closure example: counter function that captures state
|
||||||
; outer() returns inner() which increments and returns captured count
|
; outer() returns inner() which increments and returns captured count
|
||||||
MAKE_FUNCTION () #8
|
MAKE_FUNCTION () #10
|
||||||
PUSH 0
|
PUSH 0
|
||||||
PUSH 0
|
PUSH 0
|
||||||
CALL
|
CALL
|
||||||
|
|
@ -13,7 +13,7 @@ HALT
|
||||||
; Outer function body
|
; Outer function body
|
||||||
PUSH 0
|
PUSH 0
|
||||||
STORE count
|
STORE count
|
||||||
MAKE_FUNCTION () #8
|
MAKE_FUNCTION () #14
|
||||||
RETURN
|
RETURN
|
||||||
; Inner function body (closure over count)
|
; Inner function body (closure over count)
|
||||||
LOAD count
|
LOAD count
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user