Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/z-song/golisp
a simple lisp interpreter implements by golang
https://github.com/z-song/golisp
Last synced: about 2 months ago
JSON representation
a simple lisp interpreter implements by golang
- Host: GitHub
- URL: https://github.com/z-song/golisp
- Owner: z-song
- Created: 2014-10-20T06:16:40.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2015-04-10T15:51:17.000Z (almost 10 years ago)
- Last Synced: 2024-10-20T18:29:56.031Z (3 months ago)
- Language: Go
- Size: 164 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
```go
package mainimport (
"github.com/z-song/golisp"
)func main() {
code := `
;(print (type (lambda (x) (+ x x))))
;(print (int (double "123.112312")))
;(print (type (string 123)))
;(print ((lambda (x) (+ x x)) 43))
(define gt (lambda (x) (<= x 5)))
;(print (car (list 12 "hi")))
;(print (cdr (list 1 2 3 4 5 6)))
;(print (filter gt [1 5 6 8 3 10]))
;(print (fill [] 100 "hello"))
(print (append ["hello"] 123 "world" [1 2 3 4 5]))
;(print (!= "hello" (- 100 99)))
;(print (map double [1 2 4 5]))
;(define double (lambda (x) (+ x x)))
;(print (map double '(1 2 3 4)))
;(print (append "hello" " world"))
;(print (split "hello world" "o"))
`
golisp.EvalString(code)
}
```