home *** CD-ROM | disk | FTP | other *** search
- if -- Command or operation, two or three inputs.
- The first input to the if procedure must be either the word true or
- the word false. Typically, it is the output from a predicate. The
- second and (optional) third inputs are lists containing instruction
- lines. The second input is executed if the first input is true. The
- third input, if any, is executed if the first input is false:
-
- to greet :person
- if equalp :person [Ronald Reagan] [print [Hi, turkey!]] \
- [print sentence "Hi, :person]
- end
-
- In that example, the first input to if is the output from the expres-
- sion
- equalp :person [Ronald Reagan].
-
- The if procedure can be used as an operation, producing a value. In
- this case, the third input is required:
-
- print if equalp :person "Reagan ["Loser] ["Winner]
-