{"action":"created","issue":{"url":"https://api.github.com/repos/cosmos72/cl-parametric-types/issues/1","repository_url":"https://api.github.com/repos/cosmos72/cl-parametric-types","labels_url":"https://api.github.com/repos/cosmos72/cl-parametric-types/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/cosmos72/cl-parametric-types/issues/1/comments","events_url":"https://api.github.com/repos/cosmos72/cl-parametric-types/issues/1/events","html_url":"https://github.com/cosmos72/cl-parametric-types/issues/1","id":147235476,"number":1,"title":"design philosophy & survey of past libraries","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},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":14,"created_at":"2016-04-10T15:41:12Z","updated_at":"2016-04-19T19:48:51Z","closed_at":null,"body":"there are several past attempts on implementing parametric types on common lisp.\r\nas far as remember, [cl-adt](https://bitbucket.org/tarballs_are_good/cl-algebraic-data-type), https://github.com/danlentz/dstm-collections/blob/master/attic/adt.lisp . Mine is https://github.com/guicho271828/trivialib.typevar (but I'd say this is a failed attempt because it is based on CLOS/structure mixture and it was hard to debug).\r\n\r\nThis is a very interesting project, and I'd like to hear more about the design philosophy of this library, among which what I'd like to know is whether this library is designed for speed (after compilation). Well, every CLer would know how ugly C++ template is, so essentially no need to complain about its ugliness in the readme :)\r\n"},"comment":{"url":"https://api.github.com/repos/cosmos72/cl-parametric-types/issues/comments/212094250","html_url":"https://github.com/cosmos72/cl-parametric-types/issues/1#issuecomment-212094250","issue_url":"https://api.github.com/repos/cosmos72/cl-parametric-types/issues/1","id":212094250,"user":{"login":"cosmos72","id":1947270,"avatar_url":"https://avatars.githubusercontent.com/u/1947270?v=3","gravatar_id":"","url":"https://api.github.com/users/cosmos72","html_url":"https://github.com/cosmos72","followers_url":"https://api.github.com/users/cosmos72/followers","following_url":"https://api.github.com/users/cosmos72/following{/other_user}","gists_url":"https://api.github.com/users/cosmos72/gists{/gist_id}","starred_url":"https://api.github.com/users/cosmos72/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cosmos72/subscriptions","organizations_url":"https://api.github.com/users/cosmos72/orgs","repos_url":"https://api.github.com/users/cosmos72/repos","events_url":"https://api.github.com/users/cosmos72/events{/privacy}","received_events_url":"https://api.github.com/users/cosmos72/received_events","type":"User","site_admin":false},"created_at":"2016-04-19T19:48:51Z","updated_at":"2016-04-19T19:48:51Z","body":"Oh, and \"automatic resolution of overloaded functions\" means the following:\r\nAt the moment, one must write the list of template arguments every time\r\n(template\r\n  (defstruct pair\r\n    (first  nil :type <t1>)\r\n    (second nil :type <t2>)))\r\n(declaim (type (pair fixnum boolean) *p*))\r\n(defvar *p* (make-pair (fixnum boolean) :first 7 :second t))\r\n(pair-first (fixnum boolean) *p*)\r\n(setf (pair-first (fixnum boolean) *p*) 12)\r\n\r\nWith automatic overload resolution, \"a sufficiently smart compiler\" would infer the correct specialized function to call based on the DECLAIM TYPE for its arguments (in this case *p*), and one could write something like:\r\n  (pair-first :auto *p*)\r\n  (setf (pair-first :auto *p*) 12)\r\nand get the same code as above.\r\nSomething that is taken for granted in statically-typed C++, but non-trivial in Common Lisp\r\n"}}