{"id":17159292,"url":"https://github.com/jamesmoriarty/lisp","last_synced_at":"2025-04-13T13:30:53.303Z","repository":{"id":17570174,"uuid":"20373579","full_name":"jamesmoriarty/lisp","owner":"jamesmoriarty","description":"Minimal Lisp interpreter using 75LOC and only standard libraries.","archived":false,"fork":false,"pushed_at":"2023-04-02T11:32:09.000Z","size":143,"stargazers_count":53,"open_issues_count":4,"forks_count":6,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-05T12:02:50.799Z","etag":null,"topics":["conseq","exp","interpreter","lambda","lisp","procedure","quote","ruby","tinycode"],"latest_commit_sha":null,"homepage":"http://www.jamesmoriarty.xyz/lisp/","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"CyanogenMod/android_external_chromium_org_third_party_openmax_dl","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jamesmoriarty.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2014-06-01T08:31:32.000Z","updated_at":"2025-04-04T10:57:25.000Z","dependencies_parsed_at":"2023-07-14T11:29:22.373Z","dependency_job_id":null,"html_url":"https://github.com/jamesmoriarty/lisp","commit_stats":{"total_commits":121,"total_committers":4,"mean_commits":30.25,"dds":"0.17355371900826444","last_synced_commit":"7d8c89afd0391386e93dbac4f8fcd56c5f6b05c3"},"previous_names":["jamesmoriarty/lisp-rb"],"tags_count":17,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamesmoriarty%2Flisp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamesmoriarty%2Flisp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamesmoriarty%2Flisp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamesmoriarty%2Flisp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jamesmoriarty","download_url":"https://codeload.github.com/jamesmoriarty/lisp/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248720970,"owners_count":21151020,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["conseq","exp","interpreter","lambda","lisp","procedure","quote","ruby","tinycode"],"created_at":"2024-10-14T22:13:53.989Z","updated_at":"2025-04-13T13:30:52.982Z","avatar_url":"https://github.com/jamesmoriarty.png","language":"Ruby","readme":"lisp\n====\n\n![Gem Version][3] ![Gem][1] ![Build Status][2]\n\nMinimal Lisp interpreter using 75LOC and only standard libraries excluding the REPL. Inspired by [Lis.py](http://norvig.com/lispy.html).\n\n```clojure\n$ lisp-repl\nctrl-c to exit\n\u003e (begin                                                                        \n(\u003e   (define incf                                                               \n((\u003e     (lambda (x)                                                             \n(((\u003e       (set! x (+ x 1))))                                                   \n(\u003e   (define one 1)                                                             \n(\u003e   (incf one))                                                                \n2\n\u003e                                      \n```\n\nInstall\n-------\n\n```\ngem install lisp\n```\n\nUsage\n-----\n\n```clojure\nrequire \"lisp\"\n\nLisp.eval(\u003c\u003c-eos)\n  (begin\n    (define fact\n      (lambda (n)\n        (if (\u003c= n 1)\n          1\n          (* n (fact (- n 1))))))\n    (fact 10))\neos # =\u003e 3628800\n```\n\nCommandline\n-----------\n\n```\nlisp-repl\n```\n\nDocumentation\n-------------\n\n[Yardoc](https://www.jamesmoriarty.xyz/lisp/)\n\n[Rubygem](https://rubygems.org/gems/lisp)\n\n\nFeatures\n--------\n\n- [x] __constant literal number__ -\tA number evaluates to itself. _Example: 12 or -3.45e+6_\n\n- [x] __procedure call__ - (proc exp...)\tIf proc is anything other than one of the symbols if, set!, define, lambda, begin, or quote then it is treated as a procedure. It is evaluated using the same rules defined here. All the expressions are evaluated as well, and then the procedure is called with the list of expressions as arguments. _Example: (square 12) ⇒ 144_\n\n- [x] __variable reference__ - var\tA symbol is interpreted as a variable name; its value is the variable's value. _Example: x_\n\n- [x] __definition__\t- (define var exp)\tDefine a new variable and give it the value of evaluating the expression exp. _Examples: (define r 3) or (define square (lambda (x) (* x x)))._\n\n- [x] __procedure__\t- (lambda (var...) exp)\tCreate a procedure with parameter(s) named var... and the expression as the body. _Example: (lambda (r) (* 3.141592653 (* r r)))_\n\n- [x] __conditional__ -\t(if test conseq alt)\tEvaluate test; if true, evaluate and return conseq; otherwise evaluate and return alt. _Example: (if (\u003c 10 20) (+ 1 1) (+ 3 3)) ⇒ 2_\n\n- [ ] __quotation__\t- (quote exp) Return the exp literally; do not evaluate it. _Example: (quote (a b c)) ⇒ (a b c)_\n\n- [x] __assignment__ -\t(set! var exp)\tEvaluate exp and assign that value to var, which must have been previously defined (with a define or as a parameter to an enclosing procedure). _Example: (set! x2 (* x x))_\n\n- [x] __sequencing__ -\t(begin exp...)\t Evaluate each of the expressions in left-to-right order, and return the final value. _Example: (begin (set! x 1) (set! x (+ x 1)) (* x 2)) ⇒ 4_\n\n[1]: https://img.shields.io/gem/dt/lisp\n[2]: https://github.com/jamesmoriarty/lisp/actions/workflows/ci.yaml/badge.svg\n[3]: https://img.shields.io/gem/v/lisp\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjamesmoriarty%2Flisp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjamesmoriarty%2Flisp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjamesmoriarty%2Flisp/lists"}