File: t_locals.fth

package info (click to toggle)
pforth 21-10
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 820 kB
  • ctags: 873
  • sloc: ansic: 5,050; makefile: 102
file content (41 lines) | stat: -rw-r--r-- 640 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
\ @(#) t_locals.fth 97/01/28 1.1
\ Test PForth LOCAL variables.
\
\ Copyright 1996 3DO, Phil Burk

include? }T{  t_tools.fth

anew task-t_locals.fth
decimal

test{

echo off


\ test value and locals
T{ 333 value  my-value   my-value }T{  333 }T
T{ 1000 -> my-value   my-value }T{ 1000 }T
T{ 35 +-> my-value   my-value }T{ 1035 }T
: test.value  ( -- ok )
	100 -> my-value
	my-value 100 =
	47 +-> my-value
	my-value 147 = AND
;
T{ test.value }T{ TRUE }T

\ test locals in a word
: test.locs  { aa bb | cc -- ok }
	cc 0=
	aa bb + -> cc
	aa bb +   cc = AND
	aa -> cc
	bb +->  cc
	aa bb +   cc = AND
;
T{ 200 59 test.locs }T{  TRUE }T


}test