{"id":19340503,"url":"https://github.com/doccaico/lisp-zig","last_synced_at":"2025-02-24T08:27:22.756Z","repository":{"id":231840242,"uuid":"780675070","full_name":"doccaico/lisp-zig","owner":"doccaico","description":"Lisp written in Zig/Ziglang","archived":false,"fork":false,"pushed_at":"2024-04-06T07:13:19.000Z","size":107,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-06T11:38:36.305Z","etag":null,"topics":["zig"],"latest_commit_sha":null,"homepage":"","language":"Zig","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/doccaico.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,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2024-04-02T00:21:19.000Z","updated_at":"2024-04-06T07:03:36.000Z","dependencies_parsed_at":"2024-04-06T08:23:42.674Z","dependency_job_id":"364cd9a1-4e2d-4396-abe6-4225dfd23379","html_url":"https://github.com/doccaico/lisp-zig","commit_stats":null,"previous_names":["doccaico/lisp-zig"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doccaico%2Flisp-zig","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doccaico%2Flisp-zig/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doccaico%2Flisp-zig/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doccaico%2Flisp-zig/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/doccaico","download_url":"https://codeload.github.com/doccaico/lisp-zig/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240443646,"owners_count":19802084,"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":["zig"],"created_at":"2024-11-10T03:26:43.386Z","updated_at":"2025-02-24T08:27:22.708Z","avatar_url":"https://github.com/doccaico.png","language":"Zig","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Lisp-Zig (Tested on Windows only)\n\nSomething like Lisp. I referred to [Lisp interpreter in Rust](https://vishpat.github.io/lisp-rs/) and [vishpat/lisp-rs](https://github.com/vishpat/lisp-rs). Thank you Vishal Patil.\n\n## Zig version\n\n```\n// 2024/04/06\n0.12.0-dev.3533+e5d900268\n```\n\n## Usage\n\n```\n$ zig run src\\main.zig\n```\n\n## Keywords\n\n- print\n```\nprint arg\n\n(print \"foobar\")\n\n\u003e \"foobar\"\n```\n\n- define\n```\ndefine name value\n\n(define pi 3.14)\n(print pi)\n\n\u003e 3.14\n```\n\n- begin\n```\nbegin element ...\n\n(begin\n    (define a 1)\n    (define b 2)\n    (+ a b)\n)\n\n\u003e 3\n```\n\n- list\n```\nlist element ...\n\n(list 1 2 3 4 5)\n\n\u003e (1 2 3 4 5) \n```\n\n- lambda\n```\nlambda args body\n\n(define add (lambda (a b) (+ a b)))\n(add 1 2)\n\n\u003e 3\n```\n\n- let\n```\nlet binds body\n\n(begin\n    (let ((a 1) (b 2))\n        (+ a b)\n    )\n)\n\n\u003e 3\n```\n\n- map\n```\nmap function list\n\n(map (lambda (a) (+ a 10)) (list 1 2 3 4 5))\n\n\u003e (11 12 13 14 15)\n```\n\n- filter\n```\nfilter function list\n\n(begin\n    (define odd (lambda (v) (= 1 (% v 2))))\n    (define l (list 1 2 3 4 5))\n    (filter odd l)\n)\n\n\u003e (1 3 5)\n```\n\n- reduce\n```\nreduce function list\n\n(begin\n    (define add (lambda (a b) (+ a b)))\n    (define l (list 1 2 4 8 16 32))\n    (reduce add l )\n)\n\n\u003e 63\n```\n\n- range\n```\nrange (start end stride)\n\n(range 0 11)\n\n\u003e(0 1 2 3 4 5 6 7 8 9 10)\n\n(range 0 11 2)\n\n\u003e(0 2 4 6 8 10)\n```\n\n- car\n```\ncar list\n\n(car (list 1 2 3))\n\n\u003e1\n```\n\n- cdr\n```\ncdr list\n\n(car (list 1 2 3))\n\n\u003e(2 3)\n```\n\n- length\n```\nlength list\n\n(length (list 1 2 3))\n\n\u003e3\n```\n\n- null?\n```\nnull? list\n\n(null? (list 1 2 3 4 5))\n\n\u003efalse\n\n(null? (list))\n\n\u003etrue\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdoccaico%2Flisp-zig","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdoccaico%2Flisp-zig","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdoccaico%2Flisp-zig/lists"}