Homework7-sol - COP 5555 Programming Language Principles...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Homework 7 Solution NOTE: This homework is worth 200 points (so it’s worth 2% of your whole grade) *Note: Please submit your solution to the e-learning system by the deadline. No late submission is allowed. 1. Problem 1 (20 Points) Languages that employ a reference model of variables also tend to employ automatic garbage collection. Is this more than a coincidence? Explain. Solution: Yes, because in reference model there will be copies of the same object. Manually keeping track of all of them (and if there is any references at all) is tedious. 2. Problem 2 (20 Points) Most binary arithmetic operators are left-associative in most programming languages. However, most compilers are free to evaluate the operands of a binary operator in either order. Are these statements contradictory? Why or why not? Solution: Associativity has nothing to do with the order that operands get evaluated (which may even be compiler dependent). Consider the expression 1+(2+3)+(4+5). The fact that which of (2+3) and
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 6

Homework7-sol - COP 5555 Programming Language Principles...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online