imperative or functional / any
Analogy
Collected by Jan Pearce — Interview, Scott Heggen
Makes explicit that functions have inputs (parameters) and outputs (return value).
PL | NM |
---|---|
function | black box |
parameters | arrow into the box |
return value | arrow out of the box |
Parameter passing and return value.
First introducing functions.
This notional machine also encourages a discussion of pure functions, for which the only way to communicate with the outside is to read their parameter values and to produce a return value.
Do you have feedback on this notional machine? Did you find a mistake, or do you have a request for improvement? You can create an Issue on GitHub, where the description is hosted. This way we can see your feedback and address it.
For this, you need a GitHub account. Then follow this link to see the source file of this page. In there, click the ... left of the highlighted line, then pick "Reference in a new issue".