{"action":"created","issue":{"url":"https://api.github.com/repos/tonsky/datascript/issues/134","labels_url":"https://api.github.com/repos/tonsky/datascript/issues/134/labels{/name}","comments_url":"https://api.github.com/repos/tonsky/datascript/issues/134/comments","events_url":"https://api.github.com/repos/tonsky/datascript/issues/134/events","html_url":"https://github.com/tonsky/datascript/issues/134","id":120326640,"number":134,"title":"not= not working as expected","user":{"login":"hlship","id":52660,"avatar_url":"https://avatars.githubusercontent.com/u/52660?v=3","gravatar_id":"","url":"https://api.github.com/users/hlship","html_url":"https://github.com/hlship","followers_url":"https://api.github.com/users/hlship/followers","following_url":"https://api.github.com/users/hlship/following{/other_user}","gists_url":"https://api.github.com/users/hlship/gists{/gist_id}","starred_url":"https://api.github.com/users/hlship/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hlship/subscriptions","organizations_url":"https://api.github.com/users/hlship/orgs","repos_url":"https://api.github.com/users/hlship/repos","events_url":"https://api.github.com/users/hlship/events{/privacy}","received_events_url":"https://api.github.com/users/hlship/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-12-04T03:49:27Z","updated_at":"2015-12-04T03:50:02Z","closed_at":null,"body":"I'm trying to solve some NPR sunday puzzles with Datascript.\r\n\r\nI have loaded a bunch of words to form a database.\r\n\r\n```\r\n(def schema {})\r\n\r\n(defonce conn (d/create-conn schema))\r\n\r\n(defn annagram\r\n  \"Returns the word with the characters sorted into ascending order.\"\r\n  [word]\r\n  (->> word\r\n       sort\r\n       (apply str)))\r\n\r\n(defn transact-word\r\n  [^String word]\r\n  {:word word\r\n   :length (.length word)\r\n   :annagram (annagram word)})\r\n\r\n(defn add-words\r\n  [conn words]\r\n  (d/transact! conn (map transact-word words)))\r\n\r\n(add-words conn [\"cat\" \"dog\" \"god\" \"flea\"])\r\n```\r\n\r\nNow I execute a query:\r\n\r\n```\r\n(d/q '[:find ?word-1 ?word-1.word ?word-2 ?word-2.word\r\n         :where\r\n         [(not= ?word-1 ?word-2)]\r\n         [?word-1 :length ?length]\r\n         [(= 3 ?length)]\r\n         [?word-2 :length ?length]\r\n         [?word-1 :annagram ?ann]\r\n         [?word-2 :annagram ?ann]\r\n         [?word-1 :word ?word-1.word]\r\n         [?word-2 :word ?word-2.word]]\r\n       @conn)\r\n=>\r\n#{[1 \"cat\" 1 \"cat\"]\r\n  [3 \"god\" 2 \"dog\"]\r\n  [2 \"dog\" 3 \"god\"]\r\n  [3 \"god\" 3 \"god\"]\r\n  [2 \"dog\" 2 \"dog\"]}\r\n```\r\n\r\nSo ... despite me explicitly saying _don't match yourself_ ... it matches itself.  I'm *very* new to this style of coding (but fun!), but I'm pretty sure I should not see `[1 \"cat\" 1 \"cat\"]` etc. in the output.\r\n\r\nI hate adding issues to discuss this; is there an IRC or Slack where we can discuss?"},"comment":{"url":"https://api.github.com/repos/tonsky/datascript/issues/comments/161866582","html_url":"https://github.com/tonsky/datascript/issues/134#issuecomment-161866582","issue_url":"https://api.github.com/repos/tonsky/datascript/issues/134","id":161866582,"user":{"login":"hlship","id":52660,"avatar_url":"https://avatars.githubusercontent.com/u/52660?v=3","gravatar_id":"","url":"https://api.github.com/users/hlship","html_url":"https://github.com/hlship","followers_url":"https://api.github.com/users/hlship/followers","following_url":"https://api.github.com/users/hlship/following{/other_user}","gists_url":"https://api.github.com/users/hlship/gists{/gist_id}","starred_url":"https://api.github.com/users/hlship/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hlship/subscriptions","organizations_url":"https://api.github.com/users/hlship/orgs","repos_url":"https://api.github.com/users/hlship/repos","events_url":"https://api.github.com/users/hlship/events{/privacy}","received_events_url":"https://api.github.com/users/hlship/received_events","type":"User","site_admin":false},"created_at":"2015-12-04T03:50:02Z","updated_at":"2015-12-04T03:50:02Z","body":"Datascript 0.1.13"}}