RosettaCodeData/Task/Pointers-and-references/EchoLisp/pointers-and-references.echolisp
2016-12-05 23:44:36 +01:00

13 lines
250 B
Text

(define B (box 42))
→ B ;; box reference
(unbox B)
→ 42 ;; box contents
;; sets new value for box contents
(define ( change-by-ref abox avalue)
(set-box! abox avalue) )
(change-by-ref B 666)
→ #[box 666]
(unbox B)
→ 666