I am happy to announce that I have a working Joy interpreter implemented in Scheme.
Version 0.2 can be downloaded from
http://www.ccil.org/~cowan/joy.ss .
The entire program is written in portable R5RS Scheme with the exception of the routines
joy-get, joy-set!, and joy-error, which should be trivial to port to any practical Scheme.
For convenience, they appear at the top of the file.
To run the program, load it into Scheme. To run Joy code, type (joy ...) where "..." is the
Joy code. Currently, undeferror is set to 1 and autoput is set to 2; this can be changed.
The Joy stack is stored in the Scheme variable joy-stack. To define a Joy program,
type (joy-define name ...) where "..." is the Joy code.
There are a few syntax differences. Characters are represented as #\f rather than 'f.
Newline and space are #\Newline and #\Space. Lists and quotations use parentheses, not
brackets, although many Schemes support brackets as equivalent to parentheses.
Sets are the same as lists.
Version 0.2 does not support and, or, xor, not on sets.
Version 0.2 does not yet implement compare, opcase, case, app1, app11, app12, cond,
condlinrec, primrec, step, fold, map, filter, split, some, all, treestep, treerec,
treegenrec.
Version 0.2 does not provide a read-execute-print loop.
Version 0.2 does not support modules.
Version 0.2 does not have a Joy syntax translator.
Joy in Scheme will probably never support date functions, random numbers, formatd,
echo, setecho, system, gc, getenv, argc, argv, abort, quit.
Bug reports are solicited.
--
A mosquito cried out in his pain, John Cowan
"A chemist has poisoned my brain!"
http://www.ccil.org/~cowan
The cause of his sorrow
http://www.reutershealth.com
Was para-dichloro-
jcowan@...
Diphenyltrichloroethane. (aka DDT)