[<<][staapl][>>][..]
Sat Jun 7 19:03:25 CEST 2008

require + toplevel

box> ,purrr
toplevel in /home/tom/scat/
;; scat
extend: (macro) jump
;; macro
;; forth
;; purrr
box> (repl "require test/purrr18-test.f")
;; scat
extend: (macro) jump
;; macro
;; asm
extend: (macro) +
extend: (macro) dup
extend: (macro) drop
extend: (macro) swap
extend: (macro) or-jump
extend: (macro) not
extend: (macro) then
;; forth
;; purrr
;; pic18
;; dead: ((jw #<target-word>))
;; dead: ((exit))
;; dead: ((exit))
;; dead: ((exit) (qw 6) (qw 5) (qw 4))
box>


Same for (require "test/purrr18-test.f"). This isn't right: it should
reuse the scat stuff.. How to do that? Does the namespace need to be a
module namespace?

Maybe it is.. require cannot depend on context, so when a module
requires another one, that last one needs to be re-instantiated.

I guess this is a chance to finally figure out what i'm doing with
this namespace / compiler instance business ;)

EDIT:

* there is one instance of the compiler for interactive use.

* each module that is required into the toplevel instantiates a
  compiler.

the latter makes sense: loading an application without a toplevel is
possible as long as it has its own compiler associated.

one question though: isn't using a toplevel terribly inefficient then?
probably, for things not used after instantiation, garbage collection
kicks in? The compiler is simply discarded?

ok, i think i got it fleshed out now.. the only remaining things to
figure out is to remove the dependenices of the data structures on the
scat code (make dependency on the badnop side optional) and figure out
where to put the assembler (probably best in the target namespace)



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