This problem is about explicit references. In current realization of the Reflang language, arithmetic operations are not
Question:
This problem is about explicit references. In current realization of the Reflang language, arithmetic operations are not permitted on a reference value.
1. Modify the semantics of a dereference expression such that it can dereference locations specified as explicit natural numbers. See the interaction log here for an example:
2. Modify the semantics of an assignment expression such that it can assign locations specified as explicit natural numbers. See the interaction log here for an example:
3. Modify the semantics of addition and subtraction expressions such that addition and subtraction are permitted on reference values.
In this resulting language, adding one or more numeric values to a reference value creates a reference value. See the interaction log here for an example:
In this language, subtracting one or more numeric values from a reference value results in a reference value. See the interaction log here for an example:
Step by Step Answer:
An Experiential Introduction To Principles Of Programming Languages
ISBN: 9780262045452
1st Edition
Authors: Hridesh Rajan