g0dzill3r / lispy

Scheme interpreter in Kotlin
0 stars 0 forks source link

Implement set! #17

Closed g0dzill3r closed 1 year ago

g0dzill3r commented 1 year ago

Implemented.

(define (make-counter)
           (let ((count 0))
              (lambda ()
                 (set! count (+ count 1))
                 count)))

(define a (make-counter))
(a)
(a)
(a)