A Scheme dialect written in Golang
(p "hello world")
"hello world"
Number, Symbol, String, Boolean, Lambda, List, Pair
(+ 1 2)
3
(- 10 2)
8
(* 1.5 2)
3
Example
(string? "hello world")
#t
Example
(eq? 1 1)
#t
(eq? 1 2)
#f
Example
((lambda (x) (* x x)) 2)
4
Example
(list? (list 1 2 3))
#t
Example
(pair? (cons 1 2))
#t
(define <var> <value>)
Example
(define x 1)
(define (<var> <param1> ... <paramN>) <value>)
Example
(define (factorial n)
(if (eq? n 1)
1
(* (factorial (- n 1)) n)))
(factorial 5)
;; result: 120
(set! <var> <value>)
Example
(define x 1)
(set! x 10)
(p x)
;; result: 10
if, cond
Example
(define x 1)
(if (> x 5)
(p "greater than 5")
(p "less than 5"))
((lambda (x) (* x x)) 2)
4
cons, car, cdr, list, pair ...
- REPL
- Macro
- Comment
- Go Channel
- Bootstrapping