[comp.lang.forth] Designer words

ForthNet@willett.UUCP (ForthNet articles from GEnie) (08/02/90)

 Date: 07-30-90 (19:28)              Number: 456 (Echo)
   To: ALL                           Refer#: NONE
 From: ZAFAR ESSAK                     Read: (N/A)
 Subj: COUNT DELIMITED CONVERT       Status: PUBLIC MESSAGE

 In many situations I have found it useful to have an ascii to number 
 conversion utility that accepts an address and length and returns a 
 double number with a flag.  The following is the routine I have used 
 with F-PC. 

 \ Count delimited number conversion 

 : DCONVERT ( adr,len--d,-1 // d0,0) \ ascii integer to binary 
     BL SKIP DUP 
         IF  TRUE -ROT 
             0 0 2SWAP BOUNDS 
                 DO  I C@ BL = IF LEAVE THEN 
                     I C@ BASE @ DIGIT NOT 
                         IF  DROP ROT DROP 0 -ROT LEAVE 
                         THEN SWAP BASE @ UM* DROP ROT BASE @ UM* D+ 
                 LOOP ROT 
         ELSE NIP 0 0 
         THEN ; 

 The word "DIGIT" has a stack effect of ( char,base--n,?) 

 I would be interested in any comments.  Maybe there's a better way to 
 do it, or a more suitable name.  How will something like this be 
 handled in ANS Forth?  Or will it remain up to the user to define. 

 Zafar Essak. 
 ---
  * Via Qwikmail 2.01

 NET/Mail : British Columbia Forth Board - Burnaby BC - (604)434-5886   
-----
This message came from GEnie via willett through a semi-automated process.
Report problems to: uunet!willett!dwp or willett!dwp@hobbes.cert.sei.cmu.edu

ForthNet@willett.pgh.pa.us (ForthNet articles from GEnie) (08/28/90)

 Date: 08-25-90 (21:49)              Number: 3694 (Echo)
   To: JACK WOEHR                    Refer#: 3530
 From: STEVE WHEELER                   Read: NO
 Subj: GIMPEL                        Status: PUBLIC MESSAGE

 Your literary reference may be correct, but also keep in mind the 
 literary tradition of the fool who does wise things.  In this case, he 
 has a very useful product!  Or maybe you'd like to write some code you 
 want to keep proprietary, but you also want widespread usage.  Are you 
 going to buy one (or more) of every platform customers want to run it 
 on?  Why not give them something they can compile and link with, but not
 understand?

 Makes perfect sense to me.

        - Wheels

 NET/Mail : RCFB Golden, CO (303) 278-0364 VESTA & Denver FIG for Forth!
-----
This message came from GEnie via willett through a semi-automated process.
Report problems to: uunet!willett!dwp or dwp@willett.pgh.pa.us