scheme1 R7RS TODO
Lists the R7RS items we intend to add, the items we explicitly aren't adding, and rough implementation notes.
Interpreter changes
Reader
#(...)vector literals. Required by full vector support.
Runtime types
- Vector type. New heap header (
HDR.VEC?), inline length + slot array. Tag staysHEAP. - Multiple-values protocol. Internal MV vector (or stack
convention) returned from
values. Single-value contexts that receive ≠1 values are an error.
Special forms / form fixes
let-values,let*-values,define-values. Depend on the MV protocol.- Flat (one-level) quasiquote.
(quasiquote ...),(unquote x),(unquote-splicing xs)evaluated at the single template depth. Nested quasiquote is unsupported. Works on lists today; extend to vectors when those land.
New primitives
These can't be expressed in Scheme; they need new entries in
prim_table (or new syscall wrappers).
- Vector core:
vector?,make-vector,vector-length,vector-ref,vector-set!. - Multi-values:
values,call-with-values.
Prelude additions (prelude.scm)
These are blocked on the new primitives above; once those land the prelude wrappers are straightforward.
Vectors (§6.8) — over the new vector primitives
- Constructor:
vector(variadic). - List/string conversion:
vector->list,list->vector,vector->string,string->vector. - Bulk:
vector-copy,vector-copy!,vector-append,vector-fill!. - Higher-order:
vector-map,vector-for-each.
Permanent deviations (won't add)
These are deliberate omissions — document them in user-facing notes rather than tracking them as TODOs.
Out of scope:
- §6.2 numerics — keep fixnum.
- §4.3 macros /
define-syntax/syntax-rules/let-syntax/letrec-syntax. - §5.6 libraries /
define-library/import/export/cond-expand.
Types
- Distinct
chartype (chars are fixnum bytes). - Distinct R7RS port type (we have a prelude
portrecord over fds). promise,parameter,continuation,error-object,environment.
Forms
- Internal
define— interpreter raises an explicit error; users must useletrec. delay,delay-force,force,make-promise,promise?.make-parameter,parameterize.guardas an exception form (theguardkeyword is reserved forpmatchsub-clauses only).dynamic-wind.include,include-ci. (Source concatenation is shell-side.)- Nested quasiquote.
- Block comments
#| ... |#and datum comments#;.
Procedures
utf8->string,string->utf8.- All exception procs:
raise,raise-continuable,with-exception-handler,error-object?,error-object-message,error-object-irritants,read-error?,file-error?. (erroritself stays as scheme1's flush-and-exit.) call-with-current-continuation,call/cc.eval,environment,scheme-report-environment,null-environment,interaction-environment.- The entire R7RS port surface (§6.13):
call-with-port,current-input-port,current-output-port,current-error-port,input-port?/output-port?/textual-port?/binary-port?/port?/input-port-open?/output-port-open?,with-input-from-file,with-output-to-file,open-input-file/-binary-/open-output-file/-binary-,close-port/close-input-port/close-output-port, string ports (open-input-string,open-output-string,get-output-string,open-input-bytevector,open-output-bytevector,get-output-bytevector), reader/writer procs (read,read-char,peek-char,read-line,read-string,read-u8,peek-u8,u8-ready?,char-ready?,read-bytevector,read-bytevector!,write,write-shared,write-simple,write-char,write-string,write-u8,write-bytevector,flush-output-port,newline). load.current-second,current-jiffy,jiffies-per-second.features,emergency-exit.char-ci=?/char-ci<?/char-ci>?/char-ci<=?/char-ci>=?(derive fromchar-foldcaseif needed).