I was given this bit of Scheme code, and have been tasked with translating the code into Perl.
(define (makecounter)
(let ((x 0)) (lambda () (begin (set! x (+ x 1)) x))))
I know this is supposed to be a closure function, but I’m can’t quite get what this is supposed to be doing. Any ideas?
Hint: