Commit Graph

7 Commits

Author SHA1 Message Date
Jesse D. McDonald b899f0c3b0 Implement support for (call/cc), and shorthand form (let/cc).
Adds support for non-local returns, among other control-flow structures.
2012-07-14 13:44:35 -05:00
Jesse D. McDonald 14b2a1570a Add support for (quote) literal forms in compiler.ss. 2012-07-14 13:44:33 -05:00
Jesse D. McDonald 0b0b352dd6 Clean up handling of (let) and (%bind), plus misc. cleanup.
With this change, any (%bind) returned from (simplify-let) or (simplify-form)
can be assumed to be flat, with unique bound symbols. Before, this was only
true of (%lambda) forms and the output of (compile).
2012-07-14 13:44:30 -05:00
Jesse D. McDonald 6b51229c48 Raise an error if (set! ...) is applied to a form without a value.
Exception is (%tail-call ...) form, which is permitted simply because
(%tail-call ...) transfers control unidirectionally; the enclosing
(%set! ...) form wouldn't be run anyway.
2012-07-14 13:44:17 -05:00
Jesse D. McDonald 8e147f7989 Don't create extra lambdas when both results of (if ...) are trivial.
Also map () directly to %nil, and allow (%if ...) to provide a value to a set! form.
2012-07-14 13:44:05 -05:00
Jesse D. McDonald 46b18c07d6 Implement conversion to tail-call form (CPS).
Also add some basic optimizations concerning binding and setting
variables which will never be used.
2012-07-14 13:43:58 -05:00
Jesse D. McDonald 988d4264b2 Improve representation of tail-calls, and normalize primitive operations. 2012-07-14 13:43:45 -05:00