# How Foo Evaluates an Instruction

This is the hardest and most important part of the course, which is why we spend so much time on it. Once you understand how Foo evaluates functions, you can figure out the rest of the things you need to know.

The study material for the exam is here.

Starting at the beginning of an instruction, you should be able to walk through each item in the instruction and explain how Foo evaluates it. In order to accomplish this, you need to be able to do all of the following:

Instructions
Procedures
Commands
Reporters
Inputs
Outputs
Words
Lists
Evaluating an instruction
Invoking a procedure

For help with using the MicroWorlds Vocabulary help and drawing tank/hopper/pipe diagrams, see Command and Reporters, Vocabulary Builder: Turtles, Kinds of Primitives, and Kinds of Information. You can also look at videos on diagramming messages with MDiagrammer, an application written with MicroWorlds.

Look up a primitive in the MicroWorlds vocabulary and answer the questions (from Brian Harvey):

• Is it a command or a reporter?
• How many inputs?
• What type of information does the procedure like for each input?
• If the procedure is a reporter, what is its output? If a command, what is its effect?

Translate an entry from the vocabulary into a tank with hoppers or pipe, if needed.

Translate an instruction into a tank/hopper/pipe diagram (or vice versa) for instructions with:

• A setter and a word or list
• A setter and a getter that outputs a word or list
• A command and a math operator
• A command and more than one math operator
• A command and a word or list manipulator
• A command and more than one word or list manipulator

Explain the error messages below. For each message, give an example of an instruction that causes it, and fix the instruction.

I don't know how to ____
____ needs more inputs
I don't know what to do with ____
No turtle found for ____
____ does not like ____ as input
The maximum value for ____ is ____
The minimum value for ____ is ____
____ didn't report anything to ____

# 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.