#lang scribble/doc @(require scribble/manual scribble/eval scheme/runtime-path (planet cce/scheme:4:1/planet) ) @;Removed these as they seem to just give broken links, underlined in red. @;(for-label scheme/base "../macro.ss") @(define-runtime-path demo "../pic18/demo.ss") @(define box-eval (let ((eval (make-base-eval))) (eval `(begin (require (file ,(path->string (simplify-path demo)))) (require scheme/pretty) (pretty-print-columns (- (pretty-print-columns) 10)))) eval)) @(define (box-require rtp) (eval `(require (file ,(path->string (simplify-path rtp)))))) @(define-syntax ex (syntax-rules () ((_ () . args) (interaction #:eval box-eval . args)) ((_ . args) (defs+int #:eval box-eval . args)))) @(define-syntax-rule (forth x) (schemeidfont x)) @(define-syntax-rule (asm x) (schemeidfont x)) @(define (indented strs) (apply string-append (map (lambda (x) x) strs))) @(define-syntax-rule (forth-ex . strs) (verbatim (let ((code (indented 'strs))) (box-eval `(forth-compile ,(string-append . strs))) code))) @title{Staapl} @section{PIC18 Forth} @forth-ex{ planet zwizwa/staapl/pic18/route } @ex[()(code)] @forth-ex{ forth : one 1 ; : two 2 ; : three 3 ; : four 4 ; : interpret-byte route one . two . three . four ; } @ex[()(code)]