1 \ @(#) t_locals.fth 97/01/28 1.1
2 \ Test PForth LOCAL variables.
4 \ Copyright 1996 3DO, Phil Burk
6 include? }T{ t_tools.fth
13 \ test value and locals
14 T{ 333 value my-value my-value }T{ 333 }T
15 T{ 1000 -> my-value my-value }T{ 1000 }T
16 T{ 35 +-> my-value my-value }T{ 1035 }T
17 : test.value ( -- ok )
23 T{ test.value }T{ TRUE }T
25 \ test locals in a word
26 : test.locs { aa bb | cc -- ok }
35 T{ 200 59 test.locs }T{ TRUE }T
37 .( Test warning when no locals defined.) cr
38 : loc.nonames { -- } 1234 ;
39 T{ loc.nonames }T{ 1234 }T
41 \ try to put EOLs and comments in variable list
43 width \ horizontal dimension
44 height \ vertical dimension
45 -- area , calculate area of a rectangle }
49 T{ 5 20 calc.area }T{ 100 }T