3 ms·
Indeed. I built a Lisp in bash. I used a different approach to reading and consing than the FA uses. Basically what I wrote uses the idea from the IOCCC '89 "xl
by cardiffspaceman 10y ago
Indeed. I built a Lisp in bash. I used a different approach to reading and consing than the FA uses. Basically what I wrote uses the idea from the IOCCC '89 "xlisp" which is that the s-expression is represented by a string instead of by a graph of cons cells. That means that the car operation must only be done on parenthesized strings. One obtains the car by searching for the first atom after the left paren. Similarly the cdr is the rest of the atoms within the parentheses. I didn't consider other encodings of s-expressions.
Of course if you have computing to do in a bash script, bash already supports that so there is no real point. A colleague implemented a BASIC inside TECO which may have also been pointless.