Diff for /gforth/glocals.fs between versions 1.53 and 1.54

version 1.53, 2003/03/22 10:04:07 version 1.54, 2004/09/17 14:53:28
Line 310  immediate Line 310  immediate
 immediate  immediate
   
 forth definitions  forth definitions
   also locals-types
       
   \ these "locals" are used for comparison in TO
   
   c: some-clocal 2drop
   d: some-dlocal 2drop
   f: some-flocal 2drop
   w: some-wlocal 2drop
       
 \ the following gymnastics are for declaring locals without type specifier.  \ the following gymnastics are for declaring locals without type specifier.
 \ we exploit a feature of our dictionary: every wordlist  \ we exploit a feature of our dictionary: every wordlist
 \ has it's own methods for finding words etc.  \ has it's own methods for finding words etc.
 \ So we create a vocabulary new-locals, that creates a 'w:' local named x  \ So we create a vocabulary new-locals, that creates a 'w:' local named x
 \ when it is asked if it contains x.  \ when it is asked if it contains x.
   
 also locals-types  
   
 : new-locals-find ( caddr u w -- nfa )  : new-locals-find ( caddr u w -- nfa )
 \ this is the find method of the new-locals vocabulary  \ this is the find method of the new-locals vocabulary
 \ make a new local with name caddr u; w is ignored  \ make a new local with name caddr u; w is ignored
Line 661  forth definitions Line 667  forth definitions
         -&32 throw          -&32 throw
     endif ;      endif ;
 :noname  :noname
     0 0 0. 0.0e0 { c: clocal w: wlocal d: dlocal f: flocal }  
     comp' drop dup >definer      comp' drop dup >definer
     case      case
         [ ' locals-wordlist ] literal >definer \ value          [ ' locals-wordlist ] literal >definer \ value
Line 669  forth definitions Line 674  forth definitions
         \ !! 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
         [ comp' clocal drop >definer ] literal          [ comp' some-clocal drop ] literal >definer
         OF POSTPONE laddr# >body @ lp-offset, POSTPONE c! ENDOF          OF POSTPONE laddr# >body @ lp-offset, POSTPONE c! ENDOF
         [ comp' wlocal drop >definer ] literal          [ comp' some-wlocal drop ] literal >definer
         OF POSTPONE laddr# >body @ lp-offset, POSTPONE ! ENDOF          OF POSTPONE laddr# >body @ lp-offset, POSTPONE ! ENDOF
         [ comp' dlocal drop >definer ] literal          [ comp' some-dlocal drop ] literal >definer
         OF POSTPONE laddr# >body @ lp-offset, POSTPONE 2! ENDOF          OF POSTPONE laddr# >body @ lp-offset, POSTPONE 2! ENDOF
         [ comp' flocal drop >definer ] literal          [ comp' some-flocal drop ] literal >definer
         OF POSTPONE laddr# >body @ lp-offset, POSTPONE f! ENDOF          OF POSTPONE laddr# >body @ lp-offset, POSTPONE f! ENDOF
         -&32 throw          -&32 throw
     endcase ;      endcase ;

Removed from v.1.53  
changed lines
  Added in v.1.54


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