Params Flashcards

1
Q

r-value

A

value of an expression

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

l-value

A

location or address of expression

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

Parameter passed by value

A

calling method copies the r-value of the arg into the called method’s AR

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

Value result param passing

A

value of the param is copied into called AR but when method ends, final values copied back into args

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

When can aliasing occur

A

pointer manipulation
parameter is passed by reference and is also global to called method
parameter is passed by reference using same expression as an arg more once

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

Difference for globals between pass by ref and pass by value result

A

pass by ref - local var has link to global

pass by value result - treat local and global as separate in function, then when function returns update global

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

Call by name

A

every call statement is replaced by the body of the called method
each occurrence of a parameter in the called method is replaced with the corresponding arg

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

Benefit of call-by-name

A

more efficient when passing parameters that are never used

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