Diff for /gforth/string.fs between versions 1.14 and 1.17

version 1.14, 2011/01/09 20:04:15 version 1.17, 2012/08/17 22:35:27
Line 1 Line 1
 \ dynamic string handling                              10aug99py  \ dynamic string handling                              10aug99py
   
 \ Copyright (C) 2000,2005,2007,2010 Free Software Foundation, Inc.  \ Copyright (C) 2000,2005,2007,2010,2011 Free Software Foundation, Inc.
   
 \ This file is part of Gforth.  \ This file is part of Gforth.
   
Line 82 Line 82
     >r >r      >r >r
     $@ BEGIN  dup  WHILE  r@ $split i' -rot >r >r execute r> r>      $@ BEGIN  dup  WHILE  r@ $split i' -rot >r >r execute r> r>
     REPEAT  2drop rdrop rdrop ;      REPEAT  2drop rdrop rdrop ;
   
   \ string array words
   
   : $[] ( n addr -- addr' ) >r
       r@ @ 0= IF  s" " r@ $!  THEN
       r@ $@ 2 pick cells /string
       dup cell < IF
           2drop r@ $@len
           over 1+ cells r@ $!len
           r@ $@ rot /string 0 fill
           r@ $@ 2 pick cells /string
       THEN  drop nip rdrop ;
   
   : $[]! ( addr u n $addr -- )  $[] $! ;
   : $[]+! ( addr u n $addr -- )  $[] $+! ;
   : $[]@ ( n $addr -- addr u )  $[] dup @ IF $@ ELSE drop s" " THEN ;
   
   : $over ( addr u $addr off -- )
       \G overwrite string at offset off with addr u
       swap >r
       r@ @ 0= IF  s" " r@ $!  THEN
       2dup + r@ $@len > IF
           2dup + r@ $@len tuck max r@ $!len
           r@ $@ rot /string bl fill
       THEN
       r> $@ rot /string rot min move ;
 [THEN]  [THEN]
   

Removed from v.1.14  
changed lines
  Added in v.1.17


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>