--- gforth/Attic/kernel.fs 1996/09/30 13:16:11 1.4 +++ gforth/Attic/kernel.fs 1996/12/28 17:19:25 1.9 @@ -276,9 +276,23 @@ Defer source ( -- addr count ) \ core : (compile) ( -- ) \ gforth r> dup cell+ >r @ compile, ; -\ not the most efficient implementation of POSTPONE, but simple -: POSTPONE ( -- ) \ core - COMP' swap POSTPONE aliteral compile, ; immediate restrict +: postpone, ( w xt -- ) + \g Compiles the compilation semantics represented by @var{w xt}. + dup ['] execute = + if + drop compile, + else + dup ['] compile, = + if + drop POSTPONE (compile) compile, + else + swap POSTPONE aliteral compile, + then + then ; + +: POSTPONE ( "name" -- ) \ core + \g Compiles the compilation semantics of @var{name}. + COMP' postpone, ; immediate restrict : interpret/compile: ( interp-xt comp-xt "name" -- ) \ gforth Create immediate swap A, A, @@ -1345,9 +1359,9 @@ Defer key ( -- c ) \ core 1 loadline +! swap #tib ! 0 >in ! ; -: Query ( -- ) \ core-ext +: query ( -- ) \ core-ext \G obsolescent - loadfile off blk off refill drop ; + tib /line accept #tib ! 0 >in ! ; \ File specifiers 11jun93jaw @@ -1601,7 +1615,9 @@ create image-included-files 1 , A, ( po Defer 'quit Defer .status : prompt state @ IF ." compiled" EXIT THEN ." ok" ; -: (quit) BEGIN .status cr query interpret prompt AGAIN ; +: (Query) ( -- ) + loadfile off blk off refill drop ; +: (quit) BEGIN .status cr (query) interpret prompt AGAIN ; ' (quit) IS 'quit \ DOERROR (DOERROR) 13jun93jaw @@ -1715,7 +1731,7 @@ Variable argc \ addr1 u1 is a path string, addr2 u2 is an array of dir strings align here >r BEGIN - over >r [char] : scan + over >r 0 scan over r> tuck - ( rest-str this-str ) dup IF @@ -1797,9 +1813,13 @@ Defer 'cold ' noop IS 'cold ." Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA." cr ; : boot ( path **argv argc -- ) - argc ! argv ! cstring>sstring save-mem pathstring 2! main-task up! - sp@ dup s0 ! $10 + dup >tib ! tibstack ! #tib off >in off - rp@ r0 ! fp@ f0 ! ['] cold catch DoError bye ; + argc ! argv ! pathstring 2! main-task up! + sp@ s0 ! + lp@ forthstart 7 cells + @ - dup >tib ! tibstack ! #tib off >in off + rp@ r0 ! + fp@ f0 ! + ['] cold catch DoError + bye ; : bye ( -- ) \ tools-ext script? 0= IF cr THEN 0 (bye) ;