DELC ==== By Robert Smith INTRODUCTION ============ DELC is an old compiler for a subset of the Scheme-like language "Del" I developed a long time ago. It is mostly intended as a minimal example of continuation-passing style and closure conversion. It supports (up to bugs) lambdas, mutable closures, some arithmetic, reifiable continuations, and printing of integers. Booleans are just integers, but they are bound to T and NIL. There are no lists (though they can be emulated with closures). There are no strings. There is no God. LANGUAGE ======== Equivalent in Scheme/Lisp: AND OR LET LAMBDA IF PROGN Definitions: DEFINE Mutation: SETQ Boolean Values: T NIL Built-In Functions: + - * / < EQ PRINT WRITE-CHAR TERPRI CALL/CC USAGE ===== From your favorite Common Lisp, after loading delc.lisp, you have a choice of two main courses: * DEL-COMPILE-FORM * DEL-COMPILE-FILE If you have a file, everything must be wrapped in a giant DO form since only one form is actually read. EXAMPLE ======= In Lisp: > (del-compile-form '((lambda (x) (* 4 x)) (+ 1 2))) ;;;; Wrote out.c In your shell: $ gcc out.c -o out $ ./out 12 BUGS ==== * Determining if the platform is 32 or 64 bit is not portable. * There is an issue with deeply closed variables.