{"action":"opened","issue":{"url":"https://api.github.com/repos/j-cr/speck/issues/1","repository_url":"https://api.github.com/repos/j-cr/speck","labels_url":"https://api.github.com/repos/j-cr/speck/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/j-cr/speck/issues/1/comments","events_url":"https://api.github.com/repos/j-cr/speck/issues/1/events","html_url":"https://github.com/j-cr/speck/issues/1","id":342104227,"node_id":"MDU6SXNzdWUzNDIxMDQyMjc=","number":1,"title":"Support :fn specs","user":{"login":"j-cr","id":41063058,"node_id":"MDQ6VXNlcjQxMDYzMDU4","avatar_url":"https://avatars0.githubusercontent.com/u/41063058?v=4","gravatar_id":"","url":"https://api.github.com/users/j-cr","html_url":"https://github.com/j-cr","followers_url":"https://api.github.com/users/j-cr/followers","following_url":"https://api.github.com/users/j-cr/following{/other_user}","gists_url":"https://api.github.com/users/j-cr/gists{/gist_id}","starred_url":"https://api.github.com/users/j-cr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/j-cr/subscriptions","organizations_url":"https://api.github.com/users/j-cr/orgs","repos_url":"https://api.github.com/users/j-cr/repos","events_url":"https://api.github.com/users/j-cr/events{/privacy}","received_events_url":"https://api.github.com/users/j-cr/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-07-17T21:58:23Z","updated_at":"2018-07-17T21:58:23Z","closed_at":null,"author_association":"OWNER","body":"Speck needs to fully support :fn and :args specs; for that, there has to be a way to either 1) refer to the arguments by name; or 2) refer to the whole args map / conformed args + ret map. I'm thinking about something like this:\r\n\r\n```\r\n(=> (& [int? int?] (all-good? :x :y))  ; keywords refer to the names of the args\r\n    (& number?     (< :x % :y)))       ; % refers to the return value\r\n```\r\n\r\nSo the syntax is: `(& spec pred-exprs*)`, where `spec` is either a ret spec or a vector of arg specs and each of the `pred-exprs` is a boolean expression that contains keywords with the same names as args in arglists (using symbols for that would be confusing, since those names are not bound in this scope). Then the example from the spec guide would look something like this:\r\n\r\n```\r\n(defn ranged-rand\r\n    {:speck (=> (& [int? int?] (< :start :end))\r\n                (& int? (>= % :start) (< % :end)))}\r\n    [start end]\r\n    (- start (long (rand (- end start)))))\r\n```\r\n\r\nWhat about destructuring and kw-args? Disallow, try to parse the arglists?\r\nWhat if users wants to apply a pred to all args at once, as a coll? (=> argspec ret)?"}}
{"actor":{"display_login":"j-cr"}}