blob: 3c8f9ead342986da7467df7d655375e031f8ef25 [file] [log] [blame]
swissChili923b5362021-05-09 20:31:43 -07001(defun add-two (a)
2 (+ a 2))
swissChilia820dea2021-05-09 16:46:55 -07003
swissChilie9fec8b2021-06-22 13:59:33 -07004(defun calls-gc (whatever)
5 (print whatever)
6 (gc))
swissChili67bdf282021-06-06 18:46:08 -07007
swissChili6d6525e2021-06-15 21:20:53 -07008(defun main ()
swissChilie9fec8b2021-06-22 13:59:33 -07009 (let1 (a (add-two 3))
swissChili67bdf282021-06-06 18:46:08 -070010 (print "a is")
swissChilie9fec8b2021-06-22 13:59:33 -070011 (print a))
swissChilib8fd4712021-06-23 15:32:04 -070012
13 ; These allocations should be freed
14 (cons 12 (cons 34 (cons 45 nil)))
swissChilie9fec8b2021-06-22 13:59:33 -070015
swissChilib8fd4712021-06-23 15:32:04 -070016 ; But these should not
swissChilie9fec8b2021-06-22 13:59:33 -070017 (let1 (unused-but-bound (cons 5 6))
18 (let1 (val (cons 1 (cons 2 (cons 3 nil))))
19 (calls-gc val))))
swissChilib6c858c2021-06-30 21:12:43 -070020
21'(hello)