User Tools

Site Tools


en:pfw:library

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
en:pfw:library [2025-03-31 17:22] – [noForth t library use] willemen:pfw:library [2025-04-01 15:56] (current) – [noForth t library use] willem
Line 1: Line 1:
-====== A library for Forth ======+====== A library for (no)Forth ======
  
-*W.O.*+*W.O. 2025*
  
  
Line 166: Line 166:
 : FIND-CHAPTER ( adr len -- chap-adr )  \ Find chapter start address (A.N.) : FIND-CHAPTER ( adr len -- chap-adr )  \ Find chapter start address (A.N.)
     >r >r     >r >r
-    libhere lib             ahead [ 2>r ]+    libhere lib
     begin begin begin     begin begin begin
-        9 scan 3 +          [ 2r> ] then +        9 scan 3 +                      \ To begin chapter 
-        2dup < ?abort                   end library? +        2dup < throw                    End library? 
-        dup c@ r@ c@ = until            \ 1e letter ok? +        dup c@ r@ c@ = until            \ First letter ok? 
-        dup 2r@ over s<> 0= until       name ok? +        dup 2r@ over s<> 0= until       Name ok? 
-        dup 2r@ drop + c@ ch ! < until  \ length ok? +        dup 2r@ drop + c@ ch ! < until  \ Length ok? 
-    nip 2 - rdrop  rdrop ;+    nip  2 - rdrop  rdrop ;
  
 : LIB-REFILL  ( source-id –- f )  : LIB-REFILL  ( source-id –- f ) 
Line 295: Line 295:
     repeat  drop ;     repeat  drop ;
  
-: LOOK-AT   ( "name" -- )       bl word count  lib-find libtype ;+: LOOK-AT   ( "name" -- )       bl word count  find-chapter libtype ;
  
 </code> </code>
en/pfw/library.1743434576.txt.gz · Last modified: 2025-03-31 17:22 by willem