by cjlarose · 10y ago · 0 comments
Tests are specified as part of the definition, run at compile time, and if they fail no executable is produced.
{define
"list#"
permutations
[|l|
(if (null? l)
['()]
[{let permutations ((l l))
(if (null? l)
[(list '())]
[(flatmap [|x| (map [|y| (cons x y)]
(permutations (remove x l)))]
l)])}])]
;;; tests
(satisfies?
permutations
'(
(() ())
((1) ((1)))
((1 2) ((1 2)
(2 1)))
((1 2 3) ((1 2 3)
(1 3 2)
(2 1 3)
(2 3 1)
(3 1 2)
(3 2 1)))
))}
https://github.com/billsix/bug> The way that LISP/c works is sort of tricky. It utilizes a lot of string manipulation and interpretation. It doesn't need to be insanely fast, though, because it's just dealing with code; the compiled result will not suffer from any slowness.
In other words, it seems that this project just allows you to generate C code from a LISP-like syntax, but doesn't allow you to `eval` during the execution of the resulting C program. There is no runtime representation of code as data as with other lisps.