Skip to content

Instantly share code, notes, and snippets.

Created January 30, 2014 03:08
Show Gist options
  • Save anonymous/8701837 to your computer and use it in GitHub Desktop.
Save anonymous/8701837 to your computer and use it in GitHub Desktop.
(define (parser x phase counter code pointer memory stack)
(case phase
((read-file) (let ((i (read)))
(let ((file-name (if (string? i)
i
(symbol->string i))))
(let-values (((code stack) (read-file file-name)))
(values x phase counter code pointer memory stack)))))
((read-char) (values (read-char) phase counter code pointer memory stack))
((read) (values (read) phase counter code pointer memory stack))
(else (values x phase counter code pointer memory stack))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment