{"action":"created","issue":{"url":"https://api.github.com/repos/guicho271828/trivia/issues/33","repository_url":"https://api.github.com/repos/guicho271828/trivia","labels_url":"https://api.github.com/repos/guicho271828/trivia/issues/33/labels{/name}","comments_url":"https://api.github.com/repos/guicho271828/trivia/issues/33/comments","events_url":"https://api.github.com/repos/guicho271828/trivia/issues/33/events","html_url":"https://github.com/guicho271828/trivia/issues/33","id":149363251,"number":33,"title":"Add Optima's Extra Functions","user":{"login":"noctuid","id":4250696,"avatar_url":"https://avatars.githubusercontent.com/u/4250696?v=3","gravatar_id":"","url":"https://api.github.com/users/noctuid","html_url":"https://github.com/noctuid","followers_url":"https://api.github.com/users/noctuid/followers","following_url":"https://api.github.com/users/noctuid/following{/other_user}","gists_url":"https://api.github.com/users/noctuid/gists{/gist_id}","starred_url":"https://api.github.com/users/noctuid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/noctuid/subscriptions","organizations_url":"https://api.github.com/users/noctuid/orgs","repos_url":"https://api.github.com/users/noctuid/repos","events_url":"https://api.github.com/users/noctuid/events{/privacy}","received_events_url":"https://api.github.com/users/noctuid/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2016-04-19T06:37:23Z","updated_at":"2016-04-22T15:00:53Z","closed_at":null,"body":"I think it would be nice to have optima's [extra functions](https://github.com/m2ym/optima/blob/master/src/extra.lisp). Trivia has the lambda-match functions, but I don't see `if-match`, `when-match`, `let-match`, etc. I think `let-match` is especially useful and extends optima to be able to be used in much the same way as [metabang-bind](https://common-lisp.net/project/metabang-bind/user-guide.html).\r\n\r\nTaking an idea from metabang bind, it might also be nice to be able to match slots with their accessors. Also, I was wondering if it would be possible to have a `values` pattern or is `multiple-value-match` a necessity?"},"comment":{"url":"https://api.github.com/repos/guicho271828/trivia/issues/comments/213464495","html_url":"https://github.com/guicho271828/trivia/issues/33#issuecomment-213464495","issue_url":"https://api.github.com/repos/guicho271828/trivia/issues/33","id":213464495,"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":"2016-04-22T15:00:53Z","updated_at":"2016-04-22T15:00:53Z","body":"you still have to specify the class name in order to use the feature. however, `standard-object` might just work.\r\n\r\n```cl\r\n(defclass a () ((%name :reader name :initarg :x))) ;; <--- reader is NAME\r\n(defun fn (x)\r\n   (match x\r\n      ((class a name) ;; <-- accessor NAME\r\n       (print name))))\r\n(fn (make-instance 'a :x 1))\r\n;; -> 1\r\n\r\n(defun wrap (x) (name x)) ;; <--- arbitrary function works\r\n(defun fn (x)\r\n   (match x\r\n      ((class a wrap)\r\n       (print wrap))))\r\n(fn (make-instance 'a :x 1))\r\n;; -> 1\r\n```"}}