RosettaCodeData/Task/Pointers-and-references/EchoLisp/pointers-and-references.l
2023-07-01 13:44:08 -04: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