Diff for /gforth/glocals.fs between versions 1.21 and 1.26

version 1.21, 1996/05/09 18:12:59 version 1.26, 1996/09/19 22:17:31
Line 254  previous Line 254  previous
 : new-locals-reveal ( -- )  : new-locals-reveal ( -- )
   true abort" this should not happen: new-locals-reveal" ;    true abort" this should not happen: new-locals-reveal" ;
   
 create new-locals-map ' new-locals-find A, ' new-locals-reveal A,  create new-locals-map ( -- wordlist-map )
   ' new-locals-find A, ' new-locals-reveal A,
   
 vocabulary new-locals  vocabulary new-locals
 new-locals-map ' new-locals >body cell+ A! \ !! use special access words  new-locals-map ' new-locals >body cell+ A! \ !! use special access words
Line 380  forth definitions Line 381  forth definitions
   
 \ If this assumption is too optimistic, the compiler will warn the user.  \ If this assumption is too optimistic, the compiler will warn the user.
   
 \ Implementation: migrated to kernal.fs  \ Implementation: migrated to kernel.fs
   
 \ THEN (another control flow from before joins the current one):  \ THEN (another control flow from before joins the current one):
 \ The new locals-list is the intersection of the current locals-list and  \ The new locals-list is the intersection of the current locals-list and
Line 504  forth definitions Line 505  forth definitions
         code-address!          code-address!
     then ;      then ;
   
 : TO ( c|w|d|r "name" -- ) \ core-ext,local  :noname
       ' dup >definer [ ' locals-wordlist >definer ] literal =
       if
           >body !
       else
           -&32 throw
       endif ;
   :noname
     0 0 0. 0.0e0 { c: clocal w: wlocal d: dlocal f: flocal }      0 0 0. 0.0e0 { c: clocal w: wlocal d: dlocal f: flocal }
     ' dup >definer      ' dup >definer
     case      case
         [ ' locals-wordlist >definer ] literal \ value          [ ' locals-wordlist >definer ] literal \ value
         OF >body POSTPONE Aliteral POSTPONE ! ENDOF          OF >body POSTPONE Aliteral POSTPONE ! ENDOF
         [ ' clocal >definer ] literal          [ comp' clocal drop >definer ] literal
         OF POSTPONE laddr# >body @ lp-offset, POSTPONE c! ENDOF          OF POSTPONE laddr# >body @ lp-offset, POSTPONE c! ENDOF
         [ ' wlocal >definer ] literal          [ comp' wlocal drop >definer ] literal
         OF POSTPONE laddr# >body @ lp-offset, POSTPONE ! ENDOF          OF POSTPONE laddr# >body @ lp-offset, POSTPONE ! ENDOF
         [ ' dlocal >definer ] literal          [ comp' dlocal drop >definer ] literal
         OF POSTPONE laddr# >body @ lp-offset, POSTPONE 2! ENDOF          OF POSTPONE laddr# >body @ lp-offset, POSTPONE 2! ENDOF
         [ ' flocal >definer ] literal          [ comp' flocal drop >definer ] literal
         OF POSTPONE laddr# >body @ lp-offset, POSTPONE f! ENDOF          OF POSTPONE laddr# >body @ lp-offset, POSTPONE f! ENDOF
         -&32 throw          -&32 throw
     endcase ; immediate      endcase ;
 interpretation:  interpret/compile: TO ( c|w|d|r "name" -- ) \ core-ext,local
     ' dup >definer [ ' locals-wordlist >definer ] literal =  
     if  
         >body !  
     else  
         -&32 throw  
     endif ;  
   
 : locals|  : locals|
     \ don't use 'locals|'! use '{'! A portable and free '{'      \ don't use 'locals|'! use '{'! A portable and free '{'

Removed from v.1.21  
changed lines
  Added in v.1.26


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