Skip to content

Instantly share code, notes, and snippets.

@danking
Created May 3, 2012 21:12
Show Gist options
  • Select an option

  • Save danking/2589549 to your computer and use it in GitHub Desktop.

Select an option

Save danking/2589549 to your computer and use it in GitHub Desktop.
set equality is not as expected
[email protected]> (let* ((a-box (box #f))
(b-box (box #f))
(a (set 1 a-box))
(b (set 1 b-box)))
(set-box! a-box a)
(set-box! b-box b)
(displayln a)
(displayln b)
(equal? a b))
#0=#<set: 1 #&#0#>
#0=#<set: 1 #&#0#>
#f
[email protected]> (let* ((a-box (box #f))
(b-box (box #f))
(a (list 1 a-box))
(b (list 1 b-box)))
(set-box! a-box a)
(set-box! b-box b)
(displayln a)
(displayln b)
(equal? a b))
#0=(1 #&#0#)
#0=(1 #&#0#)
#t
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment