[<<][staapl][>>][..]
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
aliases.


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

(define (target-words [words #f])
  (if words
      (for-each*
       (lambda (name realm address)
         (let ((word
                (eval
                  `(new-target-word #:name ',name
                                    #:realm ',realm
                                    #:address ,address))))
           (eval
            `(begin
               (define-ns (target) ,name ,word)
               (define-ns (macro)  ,name
                 ,(case realm
                    ((code) `(scat: ',word compile))
                    ((data) `(scat: ',word literal))))))))
       words)
      (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
cleanup.


[Reply][About]
[<<][staapl][>>][..]