You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
1 year ago | |
---|---|---|
README.md | 1 year ago | |
jisp.jl | 1 year ago |
README.md
jisp
Jisp is a Lisp in Julia.
Usage
Load jisp either using include
inside the Julia repl, or by running julia -i jisp.jl
. Then, call repl
. Here's an actual session:
$ julia -i jisp.jl
_
_ _ _(_)_ | Documentation: https://docs.julialang.org
(_) | (_) (_) |
_ _ _| |_ __ _ | Type "?" for help, "]?" for Pkg help.
| | | | | | |/ _` | |
| | |_| | | | (_| | | Version 1.6.3 (2021-09-23)
_/ |\__'_|_|_|\__'_| |
|__/ |
julia> repl()
REPL mode jisp initialized. Press ) to enter and backspace to exit.
jisp>
jisp> (+ 1 1)
2
jisp> (define sqr (lambda (x) (* x x)))
#1
jisp> (sqr 2)
4
jisp> (sqr (sqr 4))
256
jisp> (define fib
(lambda (n)
(cond
((= n 1) 0)
((= n 2) 1)
(#t (+ (fib (- n 1)) (fib (- n 2)))))))
#1
jisp> (fib 5)
3
jisp> (exit)
$