CPU: Perl, Fall 2005 Perl, Week 3: More Arrays, Context, Subroutines, Lexical Variables #41

Comparison with Scheme

(define explode
  (let ((count 5))
    (lambda ()
      (begin (set! count (- count 1))
            (display "KABOOM! You have ")
            (display count)
            (display " bombs left")
            (newline)))))
Copyright © 2005 Ian Langworth