Skip to content

Instantly share code, notes, and snippets.

@3b

3b/.lisp Secret

Created April 24, 2020 01:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 3b/151f9b3bd2c982c2c1374fd75005e0b3 to your computer and use it in GitHub Desktop.
Save 3b/151f9b3bd2c982c2c1374fd75005e0b3 to your computer and use it in GitHub Desktop.
(defun foo ()
(let ((b 123))
(flet ((set-b (x)
(setf b x)))
(declare (inline set-b))
(format t "outer b = ~s~%" b)
(let ((b 345))
(format t "inner b = ~s~%" b)
(set-b 0)
(format t "inner b = ~s~%" b))
(format t "outer b = ~s~%" b))))
(foo)
;; sbcl, ccl, ecl interpreted
outer b = 123
inner b = 345
inner b = 345
outer b = 0
;; ecl 16.1.3 compiled
outer b = 123
inner b = 345
inner b = 0
outer b = 123
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment