Diff for /gforth/glocals.fs between versions 1.67 and 1.70

version 1.67, 2012/02/09 17:27:37 version 1.70, 2012/12/31 15:25:18
Line 1 Line 1
 \ A powerful locals implementation  \ A powerful locals implementation
   
 \ Copyright (C) 1995,1996,1997,1998,2000,2003,2004,2005,2007,2011 Free Software Foundation, Inc.  \ Copyright (C) 1995,1996,1997,1998,2000,2003,2004,2005,2007,2011,2012 Free Software Foundation, Inc.
   
 \ This file is part of Gforth.  \ This file is part of Gforth.
   
Line 571  forth definitions Line 571  forth definitions
     dead-code off      dead-code off
     defstart ;      defstart ;
   
   [IFDEF] free-old-local-names
 :noname ( -- )  :noname ( -- )
     locals-mem-list @ free-list      locals-mem-list @ free-list
     0 locals-mem-list ! ;      0 locals-mem-list ! ;
 is free-old-local-names  is free-old-local-names
   [THEN]
   
 : locals-;-hook ( sys addr xt sys -- sys )  : locals-;-hook ( sys addr xt sys -- sys )
     def?      def?
Line 733  is free-old-local-names Line 735  is free-old-local-names
         code-address!          code-address!
     then ;      then ;
   
 :noname  : (int-to) ( xt -- ) dup >definer
     ' dup >definer [ ' locals-wordlist ] literal >definer =      case
     if          [ ' locals-wordlist ] literal >definer \ value
         >body !          of  >body ! endof
     else          [ ' parse-name ] literal >definer \ defer
           of  defer! endof
         -&32 throw          -&32 throw
     endif ;      endcase ;
 :noname  
     comp' drop dup >definer  : (comp-to) ( xt -- ) dup >definer
     case      case
         [ ' locals-wordlist ] literal >definer \ value          [ ' locals-wordlist ] literal >definer \ value
         OF >body POSTPONE Aliteral POSTPONE ! ENDOF          OF >body POSTPONE Aliteral POSTPONE ! ENDOF
           [ ' parse-name ] literal >definer \ defer
           OF POSTPONE Aliteral POSTPONE defer! ENDOF
         \ !! dependent on c: etc. being does>-defining words          \ !! dependent on c: etc. being does>-defining words
         \ this works, because >definer uses >does-code in this case,          \ this works, because >definer uses >does-code in this case,
         \ which produces a relocatable address          \ which produces a relocatable address
Line 758  is free-old-local-names Line 763  is free-old-local-names
         OF POSTPONE laddr# >body @ lp-offset, POSTPONE f! ENDOF          OF POSTPONE laddr# >body @ lp-offset, POSTPONE f! ENDOF
         -&32 throw          -&32 throw
     endcase ;      endcase ;
   
   :noname
       ' (int-to) ;
   :noname
       comp' drop (comp-to) ;
 interpret/compile: TO ( c|w|d|r "name" -- ) \ core-ext,local  interpret/compile: TO ( c|w|d|r "name" -- ) \ core-ext,local
   
 : locals| ( ... "name ..." -- ) \ local-ext locals-bar  : locals| ( ... "name ..." -- ) \ local-ext locals-bar

Removed from v.1.67  
changed lines
  Added in v.1.70


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