week3 Flashcards

1
Q

pbr vs pbn (if expression in param)

A

pbr evaluates expression at function call, pbn evaluates expression in body (bc expression is copied into function body)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

how to implement algol copy rule

A

pass in closure

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

java value of obj is =

A

address

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

functional lang

A
  • no notion of state
  • programs are collections of function definitions and uses of function call
  • func are “first class” obj - can pass as params, return as vals, include in data struct
  • recursions only form of rep
  • binding but no assignment statement
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

tail recursion

A

recursive call is last step

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

side effects

A

any change to state of system that influences dependent values

How well did you know this?
1
Not at all
2
3
4
5
Perfectly