{"id":19138097,"url":"https://github.com/lemonpi/clisp","last_synced_at":"2025-10-17T01:45:26.731Z","repository":{"id":20000401,"uuid":"23267829","full_name":"LemonPi/Clisp","owner":"LemonPi","description":"Lisp interpreter in C++","archived":false,"fork":false,"pushed_at":"2015-01-18T00:30:23.000Z","size":4636,"stargazers_count":5,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-06T20:52:49.707Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/LemonPi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-08-23T22:39:26.000Z","updated_at":"2025-02-09T12:08:44.000Z","dependencies_parsed_at":"2022-08-27T03:40:17.041Z","dependency_job_id":null,"html_url":"https://github.com/LemonPi/Clisp","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/LemonPi/Clisp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LemonPi%2FClisp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LemonPi%2FClisp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LemonPi%2FClisp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LemonPi%2FClisp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LemonPi","download_url":"https://codeload.github.com/LemonPi/Clisp/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LemonPi%2FClisp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279269091,"owners_count":26137470,"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","status":"online","status_checked_at":"2025-10-16T02:00:06.019Z","response_time":53,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2024-11-09T06:41:44.041Z","updated_at":"2025-10-17T01:45:26.700Z","avatar_url":"https://github.com/LemonPi.png","language":"C++","readme":"### Clisp\n---------------------\n\nA lightweight (~550 lines of code) Lisp interpreter with Scheme dialect.\nI was inspired to make this after watching all the [SICP](http://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-001-structure-and-interpretation-of-computer-programs-spring-2005/video-lectures/) lectures.\n\nFeatures:\n - file inclusion e.g. (include test.scm), can be nested inside files \n - optimized tail recursion\n - first class procedures and by extension higher order procedures\n - lexical scoping so you don't have to worry about local variables clashing in called procedures\n - free typed arguments, e.g. (define (add x) ...) x is expected by the semantics to be a list, but not enforced\n - local binding (essentially giving code blocks) with keyword let\n - ; comments \n\n\n\u003ca href=\"http://www.boost.org/users/download/\"\u003e\u003cimg alt=\"Get boost\" src=\"http://www.boost.org/style-v2/css_0/get-boost.png\"\u003e\u003c/a\u003e \u003cbr\u003e\nI originally intended to include the boost parts required, but as you can see from include\\_list, \nyou're better off getting the proper boost distribution. \nTo compensate, this repository contains\na binary built on Ubuntu 14.04 which should work on most Unix based machines.\n\n\nExample:\n\n```\n(include funcs.scm)     ; don't do this! recursive inclusion is bad D:\n\n(define (if test a b) (cond ((test) a) (else b)))\n\n(define compose (lambda (f g)   ; fundamental higher order procedure\n        (lambda (x)\n                (f (g x)))))\n\n(define expt (lambda (x n)      ; exponential \n              (cond ((= n 1) x)\n                    (else (* x \n                             (expt x (- n 1)))))))\n\n(define nth-power (lambda (n)\n        (lambda (x)\n                (expt x n))))\n\n(define square (nth-power 2))\n\n(define cube (nth-power 3))\n\n(define square_and_cube (compose square cube))\n\n(define (add x)\n        (cond ((empty? x) 0)\n              (else (+ (car x) (add (cdr x))))))\n\n(begin (do something) (do somethingelse) result)    ; basic sequencing\n\n(define (add4 n)\n        (let ((x 4)) (+ x n)))  ; basic local binding\n\n(cat 'something 'somethingelse)\n\n(square 5)\n\n(add (1 2 3 4))\n```\n\nTips:\n - build by typing \"make\" in the same directory\n - build benchmark version by replacing main.cpp with timing.cpp in makefile\n - list parameters (such as x for add above) treated same as 'normal' parameters\n - interpret files with `./clisp [filename] [-p]`, add -p or -print option to force printing of file evaluation, silent by default (assumes a lot of definitions)\n    - include files with (include filename), which can be nested\n - build debug information (with step by step info) by changing build target and source in makefile to \"testing\" and \"testing.cpp\" respectively\n - requires a compiler supporting C++11\n - uses boost::variant (link above)\n - keywords (so far): define, lambda, cond, cons, cdr, list, else, and, or, not, empty?, include, begin\n - use 'quote to signify string\n     - `string` will raise an error if it's not defined, but `'string` will return string\n - use cat primitive instead of + to concatenate strings\n - expressions can extend over different lines, terminated by appropriate )!\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flemonpi%2Fclisp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flemonpi%2Fclisp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flemonpi%2Fclisp/lists"}