COMPSCI 61A Lecture Notes - Lecture 6: Higher-Order Function, Firstclass, Operand
zogo39484755 and 6 others unlocked
22
COMPSCI 61A Full Course Notes
Verified Note
22 documents
Document Summary
The fibonacci sequence (0, 1, 1 , 2 ,3, 5, 8, 13, ) Can be calculated by a computer using while loops. A function"s domain is the set of all inputs it might possibly take as arguments. A function"s range is the set of output values it might possibly return. A pure function"s behavior is the relationship it creates between input and output. Don"t repeat yourself (dry) - implement a process just once, but execute it many times. Find a common structure that allows for shared implementation assert , : throws an error with if. The common structure among functions may be a computational process rather than a number. A higher order function is a function that takes another function as an argument. Functions defined within other function bodies are bound to names in a local frame. Operator: an expression that evaluates to a function. Operand: an expression that evaluates to any value.