https://github.com/willghatch/toylithp
A lithp implementathion in JavaThcript for fun.
https://github.com/willghatch/toylithp
Last synced: about 1 month ago
JSON representation
A lithp implementathion in JavaThcript for fun.
- Host: GitHub
- URL: https://github.com/willghatch/toylithp
- Owner: willghatch
- Created: 2014-11-26T03:07:48.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2014-12-07T07:52:03.000Z (over 11 years ago)
- Last Synced: 2025-01-11T11:15:33.626Z (over 1 year ago)
- Language: JavaScript
- Size: 148 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
toylithp
========
It'th a toy, that ith only half done. My idea ith to integrate it well into the JavaThcript world... maybe I'll uthe it in a webpage or thomething.
That thaid, it'th really jutht for fun and learning.
It doeth have bathic primitiveth, thuch ath:
- define
- lambda
- quote, quasiquote, unquote, unquotesplicing
- if
- set
- begin
- defmacro
- procedure calls and macro expansion
- constant numbers, strings, symbols
Ath well ath thome predefined functhionth and valueth:
- plus, minus, div, mult, not
- t, f, n (true, false, null)
I plan to thupport both JavaThcript arrayth and linked lithttth, with [] and () thyntaxth, rethpectively. And objectth with {} thyntaxth.
The bathic functhions:
toylithp.eval(toylithp.read("(thome thexthpth (can go) (here))"))
// or
toylithp.reval("(ithnt lithp fun!)")
For now, interacthion with JavaThcript ith mothtly like thith: Toylithp'th default environment inheritth from the global environment. Acctheth to memberth of objectth ith with the dotsym macro or the dotstr function.
(dotstr foo bar baz) --> foo[bar][baz]
(dotsym foo bar baz) --> foo.bar.baz
The macroth neither bathe nor bruth their teeth. The thyntaxth ith more CL like than Thcheme like -- (defmacro name (lambda list) forms)
It'th a work in progreth. I plan to make better thyntaxth for dot, thupport object creathion with {}.