{"action":"created","issue":{"url":"https://api.github.com/repos/guicho271828/trivia/issues/12","labels_url":"https://api.github.com/repos/guicho271828/trivia/issues/12/labels{/name}","comments_url":"https://api.github.com/repos/guicho271828/trivia/issues/12/comments","events_url":"https://api.github.com/repos/guicho271828/trivia/issues/12/events","html_url":"https://github.com/guicho271828/trivia/pull/12","id":117459102,"number":12,"title":"Lambda-list pattern","user":{"login":"akssri","id":65960,"avatar_url":"https://avatars.githubusercontent.com/u/65960?v=3","gravatar_id":"","url":"https://api.github.com/users/akssri","html_url":"https://github.com/akssri","followers_url":"https://api.github.com/users/akssri/followers","following_url":"https://api.github.com/users/akssri/following{/other_user}","gists_url":"https://api.github.com/users/akssri/gists{/gist_id}","starred_url":"https://api.github.com/users/akssri/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/akssri/subscriptions","organizations_url":"https://api.github.com/users/akssri/orgs","repos_url":"https://api.github.com/users/akssri/repos","events_url":"https://api.github.com/users/akssri/events{/privacy}","received_events_url":"https://api.github.com/users/akssri/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":26,"created_at":"2015-11-17T21:49:50Z","updated_at":"2015-12-02T16:06:19Z","closed_at":"2015-11-22T16:20:40Z","pull_request":{"url":"https://api.github.com/repos/guicho271828/trivia/pulls/12","html_url":"https://github.com/guicho271828/trivia/pull/12","diff_url":"https://github.com/guicho271828/trivia/pull/12.diff","patch_url":"https://github.com/guicho271828/trivia/pull/12.patch"},"body":"This is a first pass at a lambda-list pattern. It works, but I think there currently are three issues,\r\ni) I've used the 'variable-symbol' type instead of 'variablep' in order to exclude keywords and lambda-list-keywords. \r\nii) I had resort to the ugly trick of creating list and then binding them inside patterns using '<>'; it's likely that you can think of a better way to accomplish this (in function compile-destructuring-pattern). \r\niii) The loops inside recurse-maadi are not upper-bound. \r\n"},"comment":{"url":"https://api.github.com/repos/guicho271828/trivia/issues/comments/161346207","html_url":"https://github.com/guicho271828/trivia/pull/12#issuecomment-161346207","issue_url":"https://api.github.com/repos/guicho271828/trivia/issues/12","id":161346207,"user":{"login":"guicho271828","id":1321968,"avatar_url":"https://avatars.githubusercontent.com/u/1321968?v=3","gravatar_id":"","url":"https://api.github.com/users/guicho271828","html_url":"https://github.com/guicho271828","followers_url":"https://api.github.com/users/guicho271828/followers","following_url":"https://api.github.com/users/guicho271828/following{/other_user}","gists_url":"https://api.github.com/users/guicho271828/gists{/gist_id}","starred_url":"https://api.github.com/users/guicho271828/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/guicho271828/subscriptions","organizations_url":"https://api.github.com/users/guicho271828/orgs","repos_url":"https://api.github.com/users/guicho271828/repos","events_url":"https://api.github.com/users/guicho271828/events{/privacy}","received_events_url":"https://api.github.com/users/guicho271828/received_events","type":"User","site_admin":false},"created_at":"2015-12-02T16:06:19Z","updated_at":"2015-12-02T16:06:19Z","body":"hm, not actually. your aim is something like this?\r\n\r\n```\r\n(pattern-let ((my-local-pattern (x y z) <some code which expands macros>))\r\n   (match something\r\n     ((my-local-pattern ...)\r\n      ))\r\n```\r\n\r\nit should work in compile time, so it introduces another difficulty.\r\n\r\nthe `pattern-let` automatically defined by lisp-namespace can be used in a dynamic scope, so it can only be used in a context like this:\r\n\r\n```\r\n(defpattern mypattern (arg)\r\n   (pattern-let ((vec1 (lambda (x) `(vector ,x)))) ;; dynamically binds a pattern that is locally available\r\n      (patten-expand-all arg)))\r\n\r\n(pattern-expand '(mypattern (vec1 3)) ;; -> some pattern with (vec1 3) converted to (vector 3)\r\n\r\n(pattern-expand '(vec1 3)) ;; -| error pattern-not-found , since vec1 is defined only locally\r\n```"}}