L Programming Language
The L programing language is a simple Lisp-like language. It is a work in progress.
L aims to closely follow the Revised^7 Report on the Algorithmic Language Scheme (R7RS).
wget https://github.com/juliojimenez/L/releases/download/0.0.18/llang-0.0.18-darwin-arm64
mv llang-0.0.18-darwin-arm64 llang
wget https://github.com/juliojimenez/L/releases/download/0.0.18/llang-0.0.18-linux-amd64
mv llang-0.0.18-linux-amd64 llang
./llang
L v0.0.18
>
> (+ 1 (+ 2 3))
6
> (- 3 -3)
6
> (* 3 3)
9
> (/ 12 6)
2
> (% 12 7)
5
> (= 1 2)
#f
> (= 1 1)
#t
> (= (+ 1 1) 2)
#t
> (if #t (+ 1 2) (+ 2 3))
3
> (if #f (+ 1 2) (+ 2 3))
5
> (if (= 1 2) (+ 1 2) (+ 2 3))
5
> (define a 10)
()
> (define b a)
()
> a
10
> b
10
> (define x (+ 1 2))
done
> x
3
> (define x 10)
()
> x
10
> (set! x 20)
()
> x
20
> (define x 10)
()
> (get x)
10
> (cons 1 2)
(1 . 2)
> (car (cons 1 2))
1
> (cdr (cons 1 2))
2
> (quote (cons 12 10))
(cons 12 10)
> (quote (cons #t 3))
(cons #t 3)
The apostrophe or single-quote '
is a shorthand for quote
.
> '(cons 12 10)
(cons 12 10)
> (list 1 2 3)
(1 2 3)
> (lambda () (+ 1 2))
<#lambda>
> ((lambda () (+ 1 2)))
3
> ((lambda (a b) (+ a b)) 2 2)
4
The L mascot is a lemming named Lemmy.