{"action":"opened","issue":{"url":"https://api.github.com/repos/brownplt/pyret-lang/issues/954","repository_url":"https://api.github.com/repos/brownplt/pyret-lang","labels_url":"https://api.github.com/repos/brownplt/pyret-lang/issues/954/labels{/name}","comments_url":"https://api.github.com/repos/brownplt/pyret-lang/issues/954/comments","events_url":"https://api.github.com/repos/brownplt/pyret-lang/issues/954/events","html_url":"https://github.com/brownplt/pyret-lang/issues/954","id":197472362,"number":954,"title":"String-dict equality is wrong","user":{"login":"blerner","id":918464,"avatar_url":"https://avatars.githubusercontent.com/u/918464?v=3","gravatar_id":"","url":"https://api.github.com/users/blerner","html_url":"https://github.com/blerner","followers_url":"https://api.github.com/users/blerner/followers","following_url":"https://api.github.com/users/blerner/following{/other_user}","gists_url":"https://api.github.com/users/blerner/gists{/gist_id}","starred_url":"https://api.github.com/users/blerner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/blerner/subscriptions","organizations_url":"https://api.github.com/users/blerner/orgs","repos_url":"https://api.github.com/users/blerner/repos","events_url":"https://api.github.com/users/blerner/events{/privacy}","received_events_url":"https://api.github.com/users/blerner/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"blerner","id":918464,"avatar_url":"https://avatars.githubusercontent.com/u/918464?v=3","gravatar_id":"","url":"https://api.github.com/users/blerner","html_url":"https://github.com/blerner","followers_url":"https://api.github.com/users/blerner/followers","following_url":"https://api.github.com/users/blerner/following{/other_user}","gists_url":"https://api.github.com/users/blerner/gists{/gist_id}","starred_url":"https://api.github.com/users/blerner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/blerner/subscriptions","organizations_url":"https://api.github.com/users/blerner/orgs","repos_url":"https://api.github.com/users/blerner/repos","events_url":"https://api.github.com/users/blerner/events{/privacy}","received_events_url":"https://api.github.com/users/blerner/received_events","type":"User","site_admin":false},"assignees":[{"login":"blerner","id":918464,"avatar_url":"https://avatars.githubusercontent.com/u/918464?v=3","gravatar_id":"","url":"https://api.github.com/users/blerner","html_url":"https://github.com/blerner","followers_url":"https://api.github.com/users/blerner/followers","following_url":"https://api.github.com/users/blerner/following{/other_user}","gists_url":"https://api.github.com/users/blerner/gists{/gist_id}","starred_url":"https://api.github.com/users/blerner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/blerner/subscriptions","organizations_url":"https://api.github.com/users/blerner/orgs","repos_url":"https://api.github.com/users/blerner/repos","events_url":"https://api.github.com/users/blerner/events{/privacy}","received_events_url":"https://api.github.com/users/blerner/received_events","type":"User","site_admin":false}],"milestone":null,"comments":0,"created_at":"2016-12-24T18:03:26Z","updated_at":"2016-12-24T18:03:26Z","closed_at":null,"body":"Assume for the moment we have a method `clone-now` on string-dicts, to allow us to easily clone a mutable string dict.  (I've implemented this method as an optimization that's paying off in speeding up js-dag-utils, so it's a good thing to have...)  Then the following code is incorrect:\r\n\r\n```\r\ninclude string-dict\r\n\r\nl1 = lam(): 5 end\r\n\r\nd1 = [mutable-string-dict: \"a\", 1, \"b\", l1, \"c\", 3]\r\nd2 = d1.clone-now()\r\n\r\nprint(identical(d1, d2)) # ==> false\r\nprint(equal-now(d1, d2)) # ==> true !!! YIKES\r\nprint(equal-now(d1.get-value-now(\"b\"), d2.get-value-now(\"b\"))) # ==> Error: tried to compare incomparable values\r\n```\r\n\r\nThe problem is in the equals method itself, which only looks whether two fields are NotEqual, and discards the answer otherwise and moves on to another field.  Since the last field in this dictionary (at least in 2/3 of the possible field iteration orders) is not a function, the equality succeeds."}}
{"actor":{"display_login":"blerner"}}