Methods and functions
Alice has both methods and functions.
The distinction between them is:
- A method sends a message to an object asking it to perform
some action. Importantly, a method does not return a value.
- A function in Alice is also sends a message to an object,
typically asking the object to send back some information. (The
function may also ask the object to perform some action.) Most importantly, a function in Alice
always
returns a value.
This lesson will deal primarily with functions and the values that they
return.