{"id":28433510,"url":"https://github.com/vlad-km/moren-generic","last_synced_at":"2026-01-28T20:02:48.107Z","repository":{"id":180154000,"uuid":"102877112","full_name":"vlad-km/Moren-generic","owner":"vlad-km","description":"Simple implementation of CommonLisp Generic Function for  Moren environment","archived":false,"fork":false,"pushed_at":"2025-12-20T10:47:53.000Z","size":157,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-12-21T12:48:16.418Z","etag":null,"topics":["common-lisp","electron","lisp","moren"],"latest_commit_sha":null,"homepage":"","language":"Common Lisp","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vlad-km.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2017-09-08T15:37:56.000Z","updated_at":"2025-12-18T12:38:54.000Z","dependencies_parsed_at":null,"dependency_job_id":"2efb2c77-3af2-4b36-bf28-8f8878d59517","html_url":"https://github.com/vlad-km/Moren-generic","commit_stats":null,"previous_names":["vlad-km/dasgen","vlad-km/moren-generic"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/vlad-km/Moren-generic","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vlad-km%2FMoren-generic","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vlad-km%2FMoren-generic/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vlad-km%2FMoren-generic/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vlad-km%2FMoren-generic/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vlad-km","download_url":"https://codeload.github.com/vlad-km/Moren-generic/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vlad-km%2FMoren-generic/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28850474,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-28T15:15:36.453Z","status":"ssl_error","status_checked_at":"2026-01-28T15:15:13.020Z","response_time":57,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["common-lisp","electron","lisp","moren"],"created_at":"2025-06-05T18:09:59.357Z","updated_at":"2026-01-28T20:02:48.102Z","avatar_url":"https://github.com/vlad-km.png","language":"Common Lisp","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DAS- tiny implementation of CommonLisp Generic Function for Moren environment\n\n\n## Disclaime\n\n-  This Code execute in `zero safety` mode.\n-  Code written in dialect `non-compliant` ANSI Common Lisp\n-  Using `CLOS` into the  code, will slow it down to its `CLOS level`.\n-  This code is written for use in a `narrow domain`.\n\n\n## das:generic\n\n*das:generic* ::= *name* ( *args* *optionals*) ( *methods*)\n\n*name*::= `symbol`\n\n*args* :: `symbol` | `symbol` ... `symbol`\n\n*optionals* ::= `\u0026optional` | `\u0026keyword` | `\u0026rest`\n\n*methods* ::= (:method (*arguments*) *forms*)\n\n*arguments* ::= symbol | (symbol type)\n\n\n```lisp\n   (das:generic name (x y z))\n   (das:generic name (x \u0026optional a b c))\n   (das:generic name (pip \u0026key x y z))\n   \n   (das:generic name (a b c)\n      (:method (a b c) (list c b a))\n      (:method ((a symbol) b c) (list a (list b c))))\n      \n  (name 1 2 3) =\u003e (3 2 1)\n  (name 'tag 2 3) =\u003e (tag (3 2))\n  \n```\n\n## das:method\n\n*defmethod syntax* `:before`,`:after`,`:around`  *not implemented*.\n\n*das:method* *function-name*  *specialized-lambda-list*  *forms*)\n\n*function-name*::= `symbol`\n\n*specialized-lambda-list*::= *vars* *optional* | *vars* *typed-vars* *optionals*\n\n*vars* ::= `symbol` ... `symbol`\n\n*typed-vars* ::= (`symbol` *type-name*) ... (`symbol` *type-name*)\n\n*type-name* ::= `integer` | `float` | `character` | `string` | `list`  | `consp` | `function` \n| `hash-table` | `vector` | `symbol` | `keyword`  | *any-type-name*\n\n*optionals* ::= *only \u0026optional/\u0026key/\u0026rest forms*\n\n*any-type-name* ::= any lisp entity that has a `predicate`, and registered with the function `das:def-type`\n\n\n```lisp\n    (das:generic compare-slots (x y))    \n    (das:method compare-slots ((x integer) (y integer)) )\n    (das:method compare-slots ((x integer) y ) )\n    (das:method compare-slots ((x list) (y list)) )\n\n    (defstruct (negation (:constructor negation (expr)) :named (:type vector)) expr)   \n    (das:def-type 'negation (lambda (p) (negation-p p)))\n\n    (defstruct (addition (:constructor addition (left right)) :named (:type vector)) left right)\n    (das:def-type 'addition (lambda (p) (addition-p p)))\n\n    (das:generic evaluate (expr))\n    (das:method evaluate ((expr negation))\n            (- (evaluate (negation-expr expr))))\n    (das:method evaluate ((expr addition))\n            (+ (evaluate (addition-left expr))\n               (evaluate (addition-right expr))))\n     (das:method evaluate ((expr number))\n            expr)\n\n     (evaluate (addition 5 (negation -5)))\n\n```\n\n## das:def-type\n\n*das:def-type* :*type* :*predicate* \n\n*type* ::= `symbol`\n\n*predicate* ::= 'symbol` | `function`\n\n```lisp\n(defstruct (stub (:type vector) :named) (fn (error \"undef function\") :type function))\n(das:def-type :type 'stub :predicate (lambda (x) (stub-p x)))\n\n(das:generic anything (x y))\n(das:method anything (x y) (format t \"Don't know what do this tool: ~a  with this object: ~a~%\" x y))\n(das:method anything ((than stub) (with vector)) (ffi:call (with \"forEach\") (stub-fn than)))\n(das:method anything ((than function) (with vector)) (ffi:call (with \"forEach\") than))\n\n(setq heap (make-array '(5) :initial-element (ffi:ref \"undefined\")))\n(setq ps (make-stub :fn (lambda (x) (format t \"And what do with it ~a?~%\" x))))\n(anything ps heap)\n(anything t (list 1 2 3))\n\n(das:method anything ((than function) (with list))\n  (let (result)\n      (dolist (it with (reverse result)) (push (funcall than it) result))))\n\n(anything 'integerp (list 1 2 3 4))\n\n```\n\n## das:the-type-of\n\n*das:the-type-of* `object`\n\n```lisp\n(das:the-type-of 1) =\u003e t\n(das:the-type-of nil) =\u003e nil\n(das:the-type-of ps) =\u003e stub\n```\n\n## das:the-typep\n\n*das:the-typep* `object` `type-name`\n\n*object* ::= `\u003cany entitie\u003e`\n\n*type-name* ::= `symbol`\n\n```lisp\n(das:the-typep (list 1 2 3) 'list) =\u003e t\n(das:the-typep ps 'stub) =\u003e t\n(das:def-type :name 'list-triple \n              :predicate (lambda (x) \n                           (when  (listp x) (eq (length x) 3))))\n(das:the-typep '(1 2 3) 'list-triple) =\u003e t\n```\n\n## Compilation\n\n```lisp\n\n(setq bin (make-array 0 :fillpointer 0)) \n(load \"src/package.lisp\" :hook bin)\n(load \"src/das-types.lisp\" :hook bin)\n(load \"src/das-generic.lisp\" :hook bin :output \"./dasgen.js\")\n\n;; further use:  (require \"./dasgen.js\") or html:\u003cscript \u003e\n\n```\n\n### Copyright 2017,2025 @vlad-km\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvlad-km%2Fmoren-generic","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvlad-km%2Fmoren-generic","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvlad-km%2Fmoren-generic/lists"}