{"action":"created","issue":{"url":"https://api.github.com/repos/jeaye/orchestra/issues/13","repository_url":"https://api.github.com/repos/jeaye/orchestra","labels_url":"https://api.github.com/repos/jeaye/orchestra/issues/13/labels{/name}","comments_url":"https://api.github.com/repos/jeaye/orchestra/issues/13/comments","events_url":"https://api.github.com/repos/jeaye/orchestra/issues/13/events","html_url":"https://github.com/jeaye/orchestra/issues/13","id":275633097,"number":13,"title":"Speccing higher-order functions","user":{"login":"l3nz","id":1101849,"avatar_url":"https://avatars3.githubusercontent.com/u/1101849?v=4","gravatar_id":"","url":"https://api.github.com/users/l3nz","html_url":"https://github.com/l3nz","followers_url":"https://api.github.com/users/l3nz/followers","following_url":"https://api.github.com/users/l3nz/following{/other_user}","gists_url":"https://api.github.com/users/l3nz/gists{/gist_id}","starred_url":"https://api.github.com/users/l3nz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/l3nz/subscriptions","organizations_url":"https://api.github.com/users/l3nz/orgs","repos_url":"https://api.github.com/users/l3nz/repos","events_url":"https://api.github.com/users/l3nz/events{/privacy}","received_events_url":"https://api.github.com/users/l3nz/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-11-21T09:02:18Z","updated_at":"2017-11-21T09:07:08Z","closed_at":null,"author_association":"NONE","body":"I am trying to spec a higher-order function:\r\n\r\n```\r\n(defn expect-integer []\r\n  (fn [i]\r\n    (inc i)))\r\n\r\n(s/fdef\r\n  expect-integer\r\n  :ret (s/fspec :args (s/cat :i int?)\r\n                :ret int?))\r\n\r\n(orchestra/instrument)\r\n```\r\n\r\nBut if I run it:\r\n\r\n```\r\n((expect-integer) 1)\r\n=> 2\r\n((expect-integer) \"a\")\r\nClassCastException java.lang.String cannot be cast to java.lang.Number  clojure.lang.Numbers.inc (Numbers.java:112)\r\n```\r\n\r\nSo the spec is not run. Is there a way to do it?\r\n\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/jeaye/orchestra/issues/comments/345961592","html_url":"https://github.com/jeaye/orchestra/issues/13#issuecomment-345961592","issue_url":"https://api.github.com/repos/jeaye/orchestra/issues/13","id":345961592,"user":{"login":"l3nz","id":1101849,"avatar_url":"https://avatars3.githubusercontent.com/u/1101849?v=4","gravatar_id":"","url":"https://api.github.com/users/l3nz","html_url":"https://github.com/l3nz","followers_url":"https://api.github.com/users/l3nz/followers","following_url":"https://api.github.com/users/l3nz/following{/other_user}","gists_url":"https://api.github.com/users/l3nz/gists{/gist_id}","starred_url":"https://api.github.com/users/l3nz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/l3nz/subscriptions","organizations_url":"https://api.github.com/users/l3nz/orgs","repos_url":"https://api.github.com/users/l3nz/repos","events_url":"https://api.github.com/users/l3nz/events{/privacy}","received_events_url":"https://api.github.com/users/l3nz/received_events","type":"User","site_admin":false},"created_at":"2017-11-21T09:07:08Z","updated_at":"2017-11-21T09:07:08Z","author_association":"NONE","body":"I have a feeling that this might be added in a way similar to `defn-spec`, maybe having a `fn-spec`  macro, that will do the definition and instrument the function if the namespace requires it."}}
{"actor":{"display_login":"l3nz"}}