Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/guillep/lisp-interpreter
Lisp interpreter implementation in Pharo
https://github.com/guillep/lisp-interpreter
Last synced: 16 days ago
JSON representation
Lisp interpreter implementation in Pharo
- Host: GitHub
- URL: https://github.com/guillep/lisp-interpreter
- Owner: guillep
- License: mit
- Created: 2018-01-19T13:18:53.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2018-01-22T15:21:41.000Z (almost 7 years ago)
- Last Synced: 2024-10-31T06:42:04.251Z (2 months ago)
- Language: Smalltalk
- Size: 15.6 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Lisp interpreter
Lisp interpreter implementation in Pharo.
Creating an interpreter:
```smalltalk
lisp := Lisp scheme.
```Lambda definitions:
```smalltalk
lisp evaluate: #(define factorial (lambda (n)
(if (= n 1)
1
(* n (factorial (- n 1) ))))).
lisp evaluate: #(define map (lambda (f list)
(if (#'null?' list)
nil
(cons (f (car list)) (map f (cdr list)))))).lisp evaluate: #(define double (lambda (n) (* 2 n))).
lisp evaluate: #(map double (cons 1 (cons 2 (cons 3 nil)))).
```Function definitions.
```smalltalk
lisp evaluate: #(define (factorial n)
(if (= n 1)
1
(* n (factorial (- n 1) )))).
lisp evaluate: #(factorial 5).
```