Minimum set of primitives?
Wed, 18 Mar 1998 08:00:04 -0500
Chris Hanson wrote:
> I remember something about there being seven primitives...
In terms of special forms (syntax), all of Scheme is syntactic sugar for:
lambda, a conditional (case is my preference), set!, quote
To create any definitions, you will have to add define. And if you
want to be able to define the rest of the syntax using macros, you'll
need define-macro (or equivalently, a function that returns a value
that define recognizes as a macro). Some scheme compilers (including
Steele's Rabbit, and my work) convert everything into this subset and
then optimize the bejezuz out of it.
In terms of primitive functions, there are probably at least 30, even
if you were being rigidly minimalist (for very little benefit, I
A minimum set:
eq? = < + - * / quotient car cdr cons truncate set-car! set-cdr!
inexact->exact (and other transformers)
string functions (or a way to get inside a string)
vector functions (at least a minimal subset of them)
pair? list? number? procedure? (you could define most predicates in
terms of a get-tag, or some-such, function)
some more that I'm probably forgetting.