Welcome to the Outlet REPL
Outlet is a new language to experiment with compiling Lisp to other languages like javascript and lua. Read more about it here and download it here.
Type some outlet below:
result
output
generated
Examples
(define foo 5)
(define (bar x)
(+ x 1))
(define (buz x)
(let ((y x)
(add_1 (if (< x 0)
(lambda (n) (- n 1))
(lambda (n) (+ n 1)))))
(add_1 y)))
(define (fib n)
(if (eq? n 0)
n
(+ n (fib (- n 1)))))
(for-each
(lambda (x) (display x))
'(1 2 3 4))
;; rest parameters
(define (baz one two . three)
(pp three))
(baz "a" "b" "c" "d" "e" "f")
;; eval
(pp (eval-outlet '(baz 1 2 3 4)))
;; ->string
(display (->string '(foo 2 bar 4 "hel\nlo\"fdfsf")))
;; Example tracer using `alert`:
(require (trace "./trace"))
(trace.set-prompt alert)
(trace-source (let ((i (+ 4 5)))
(+ i (* 2 (/ 3 4)))))