--- gforth/lib.fs 1997/05/29 19:42:13 1.1 +++ gforth/lib.fs 1998/07/08 16:47:31 1.3 @@ -49,7 +49,7 @@ Variable libs 0 libs ! \G OS name of symbol as counted string here 2dup swap 2 cells + dup @ A, ! 2swap 1 and IF fcall-table ELSE icall-table THEN swap - cells 2* + , 0 , bl parse-word string, @proc ; + cells 2* + , 0 , bl sword string, @proc ; -1 Constant (addr) 0 Constant (int) @@ -91,7 +91,7 @@ DOES> ( x1 .. xn n -- ) DOES> ( -- addr ) [ 2 cells ] Literal + @ ; -: lib: ( "name" "file" -- ) +: library ( "name" "file" -- ) \G loads library "file" and creates a proc defining word "name" \G library format: \G linked list of libraries @@ -99,7 +99,7 @@ DOES> ( -- addr ) \G linked list of library's procs \G OS name of library as counted string Create here libs @ A, dup libs ! - 0 , 0 A, bl parse-word string, @lib + 0 , 0 A, bl sword string, @lib DOES> ( pars/ type -- ) over -1 = IF label: ELSE @@ -112,10 +112,11 @@ DOES> ( pars/ type -- ) : init-shared-libs ( -- ) defers 'cold libs - BEGIN @ dup WHILE >r + 0 libs BEGIN @ dup WHILE dup REPEAT drop + BEGIN dup WHILE >r r@ @lib r@ 2 cells + BEGIN @ dup WHILE r@ over @proc REPEAT - drop r> - REPEAT drop ; + drop rdrop + REPEAT drop ; ' init-shared-libs IS 'cold