blob: bacfea8b8e168102cbcbaf4c80680d44202b7916 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
|
# Bamboo Lisp
Embeddable & Hackable Lisp-2 Interpreter
(Work in Progress)
## Build
Debug:
```bash
git submodule init --recursive
make
```
Release:
```bash
git submodule init --recursive
make profile=release
```
## Example
```lisp
(defun Y (f)
(funcall
(lambda (g) (funcall g g))
(lambda (h)
(funcall f (lambda args (apply (funcall h h) args))))))
(defun fibo-impl (self)
(lambda (n)
(if (<= n 2)
1
(+ (funcall self (- n 1)) (funcall self (- n 2))))))
(defvar fibo (Y #'fibo-impl))
(funcall fibo 10)
```
|