Reference

Video Lessons

Learning Objectives

Predicates

Before You Study this Material

Before you can understand the material in this section, you must know the material in How Foo Evaluates an Instruction. It is especially important that you are clear that:

  • A procedure (command or reporter) can have zero or more inputs
  • The inputs a procedure likes may be a word or a list
  • Some procedures only like particular words or lists as inputs
  • A procedure is invoked when all of its inputs have been collected
For some of this material, you will also need to be familiar with the following resources:

MicroWorlds EX Help
    Programming
        Programming Environment
            About Private and Public Procedures
            About Procedures
            Comments in Procedures
            Formatting Your Procedures

What You Should Know About Predicates

Predicates are a kind of reporter (other kinds of reporters include getters, math operators, and word manipulators).
Predicates may have zero or more inputs
Different predicates may like different inputs
Like all reporters, a predicate has exactly one output
The output of a reporter is either "true or "false

A predicate's procedure name usually ends with a question mark (?). Primitive predicates with names ending with a question mark are:

  • done?
  • empty?
  • eot?
  • equal?
  • found?
  • greater?
  • identical?
  • key?
  • less?
  • member?
  • name?
  • touching?
Important exceptions are the three special predicates:
  • not
  • and
  • or
These three predicates have special meaning to Foo. The meanings can be confusing because they are similar to English but not identical.

What You Should Be Able to Do

Look up a primitive predicate and tell:
How many inputs does it need?
What kind of inputs?
When does it output "true? When does it output "false?
Use a predicate correctly with IF or IFELSE (you might also interested in WHEN and WAITUNTIL)
Write a predicate using OUTPUT
Explain the difference between OUTPUT, STOP, and STOPALL
Correctly use REPEAT (you may also be interested in DOTIMES and DOLIST)

About the Center for Talent Development

Center for Talent Development (CTD), housed at Northwestern University's School of Education and Social Policy, is an accredited learning center and research facility that identifies, educates and supports gifted students and their families and serves as a leader in gifted education. Learn more about the Center for Talent Development.