File: TokConstCondTst02.fth

package info (click to toggle)
fcode-utils 1.0.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 46,768 kB
  • sloc: ansic: 9,717; csh: 241; makefile: 129; sh: 17
file content (52 lines) | stat: -rw-r--r-- 1,341 bytes parent folder | download | duplicates (20)
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
42
43
44
45
46
47
48
49
50
51
52
\  Common code (insert obligatory sneeze here)
\      for second Nested "Constant" Conditionals test

\  Updated Wed, 29 Jun 2005 at 13:41 by David L. Paktor

\  File that FLOADs this has already put TRUE or FALSE on the stack.

f[  constant  boobalah? f]

: whatziz
    ." This is the "
    f[ boobalah? [if] f] ." True "  f[  [else]  f] ." False"  f[  [then]  f]
    ."  side of the test." cr
;
headers

: tell-me
    ." Begin Nested ""Constant"" Test Test"
    f[ boobalah? f] [if]
    [message]  The TRUE path has wisely been chosen, Boobalah!
       ." Is True, level 1"
       f[ boobalah? f] [if]
	   " Is True and is True, level 2"
       [else]
	   " Is True but is Not True.  What?"
       [then]
       ." Middle of level 2"
       f[ boobalah? 0= f] [if]
	   " Is True and is False.  What?"
       [else]
	   " Is True and is Not False, level 2"
       [then]
    [else]
    [message]  Oy, Boobalah.  You have foolishly chosen the FALSE path.
       ." Is Not True, level 1"
       f[ boobalah? f] [if]
	   " Is Not True but is True.  What?"
       [else]
	   " Is Not True and is Not True, level 2"
       [then]
       ." Middle of Not level 2"
       f[ boobalah? 0= f] [if]
	   " Is Not True and is False, level 2"
       [else]
	   " Is Not True and is Not False.  What?"
       [then]
    [then]
;

: whoozis  whatziz  ;