Skip to content

Instantly share code, notes, and snippets.

@shirok
Last active March 9, 2020 07:58
Show Gist options
  • Save shirok/40320d4dd13c4744dbc9da0b5608c921 to your computer and use it in GitHub Desktop.
Save shirok/40320d4dd13c4744dbc9da0b5608c921 to your computer and use it in GitHub Desktop.
[1]> (let ((cs ()))
(dolist (x '(1 2 3 4 5))
(push #'(lambda () x) cs))
(mapcar #'funcall cs))
(5 5 5 5 5)
[2]> (let ((cs ()))
(dolist (x '(1 2 3 4 5))
(push (let ((x x)) #'(lambda () x)) cs))
(mapcar #'funcall cs))
(5 4 3 2 1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment