Files in the top-level directory from the latest check-in
- concat-test.asd
- concat.asd
- main.lisp
- README.wiki
- test.lisp
CL-CONCAT
Concatenative programming in Common Lisp
cl-concat brings the conciseness of the concatenative paradigm to Common Lisp.
Glean an overview of the system from:
- Function
repl - Macro
-> - File
test.lisp
Features already implemented
- REPL
- Ergonomic restarts for providing arity and return behavior
Features planned
- Concatenative word definition that works by defining a reasonable Lisp function
Idiosyncrasies
Subtraction is backwards
In most concatenative languages, the input line 7 4 - . yields 3.
Then readers can more naturally subvocalize "7 minus 4".
Not so in concat. Concat, which uses postfix notation, tries to meld as seamlessly as it can with Common Lisp, which uses prefix notation. For consistency, concat represents Lisp functions and their arguments as the usual Lisp forms in reverse.
(set 'foo 5)corresponds to5 'foo set.(- 7 4)corresponds to4 7 -.
So subtraction feels a bit backwards. The builtin negate multiplies a number by -1 and can be used unambiguously:
4 negate 7 +is like-4 7 +.4 7 negate +is like4 -7 +.
In Common Lisp, - does this when given one argument.
Concat requires fixed-arity functions, and it already assigns - arity 2.