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 T{ 987 to my-value my-value }T{ 987 }T
18 : test.value ( -- ok )
24 T{ test.value }T{ TRUE }T
26 \ test compile time behavior of a VALUE
27 567 value VAL3 immediate
31 \ test locals in a word
32 : test.locs { aa bb | cc -- ok }
41 T{ 200 59 test.locs }T{ TRUE }T
43 .( Test warning when no locals defined.) cr
44 : loc.nonames { -- } 1234 ;
45 T{ loc.nonames }T{ 1234 }T
47 \ try to put EOLs and comments in variable list
49 width \ horizontal dimension
50 height \ vertical dimension
51 -- area , calculate area of a rectangle }
55 T{ 5 20 calc.area }T{ 100 }T