Tue Jun 24 16:33:25 CEST 2008

interactive compilation

2 things:

  * what to do with the global code accumulator?

  * no more 'compile' mode for quick & dirty interactive compilation:
    use files/buffers instead.

let's have a look first at serialization. it's not possible to
serialize macros, but it might be possible to serialize constants and

ok. got a function to read/write the namespace. on write, the macros
get recreated.

(define (target-words [words #f])
  (if words
       (lambda (name realm address)
         (let ((word
                  `(new-target-word #:name ',name
                                    #:realm ',realm
                                    #:address ,address))))
               (define-ns (target) ,name ,word)
               (define-ns (macro)  ,name
                 ,(case realm
                    ((code) `(scat: ',word compile))
                    ((data) `(scat: ',word literal))))))))
      (for/list ((name (ns-mapped-symbols '(target))))
        (let ((word (find-target-word/false name)))
          (list name
                (target-word-realm word)
                (target-word-address word))))))

the global accumulator could be replaced by a parameter, so
file->words conversion is possible locally. this deserves some