chicken-hackers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Chicken-hackers] Another violation of R5RS in Chicken Scheme


From: Thomas Bushnell BSG
Subject: [Chicken-hackers] Another violation of R5RS in Chicken Scheme
Date: Wed, 30 Dec 2009 01:28:10 -0800

Well in all Schemes.  This is a hole in R5RS.

        Null-environment returns a specifier for an environment that is
        empty except for the (syntactic) bindings for all syntactic
        keywords defined in this report that are either required or both
        optional and supported by the implementation.

Chicken Scheme faithfully attempts to do this the only way one could.
But alas, there is a bit of syntax in R5RS's set which does not seem to
be able to be implemented without auxiliary procedures of some sort.
Since quasiquote is a syntactic keyword, it is required to be bound in
the null-environment, and have its usual behavior.  But alas, it does
not for the obvious reason.

(eval '`(foo) (null-environment 5))
        => Error: unbound variable: ##sys#cons

Likewise, delay fails:

(eval '(delay (+ 3 5)) (null-environment 5))
        => Error: unbound variable: ##sys#make-promise

To fix the delay case is easier.  Since make-promise uses no auxiliary
procedures, delay could be rewritten to contain the code for
make-promise in the expansion.

Fixing quasiquote would be harder.  It could no longer expand into calls
to cons, list->vector, and such.  This is achievable only at the expense
of forcing pairs and vectors to be implemented in pure lambda calculus.

I don't seriously suggest "fixing" either of these.  But I leave them to
you all as a New Year's present.

Thomas






reply via email to

[Prev in Thread] Current Thread [Next in Thread]