Problem regarding the order of evaluation

Assignment Help Basic Computer Science
Reference no: EM13963462

Order of Evaluation

In pure lambda calculus, the order of evaluation of subexpressions does not effect the value of an expression. The same is true for pure Lisp: if a pure Lisp expres- sion has a value under the ordinary Lisp interpreter, then changing the order of evaluation of subterms cannot produce a different value.

To give aconcrete example, consider the following section of Lisp code:

(define a ( ... ))

(define b ( ... ))... (define f (lambda (x y z) (cons (car x) (cons (car y) (cdr z))))) ... (f e1 e2 e3)

The ordinary evaluation order for the function call (f e1 e2 e3) is to evaluate the arguments e1 e2 e3 from left to right and then pass this list of values to the function f.

Give an example of Lisp expressions e1 e2 e3, possibly by using functions rplaca or rplacd with side effects, so that evaluating expressions from left to right gives a different result from that obtained by evaluating them from right to left. You may ?ll in speci?c declarations for a or b if you like and refer to a or b in your expressions. Explain brie?y, in one or two sentences, why one order of evaluation is different from the other.

Reference no: EM13963462

Questions Cloud

What mass of helium will be required. : A 1-liter container of nitrogen gas (N2) at a temperature of 23c is intially at a pressure of 1.25 atm. because of a slow leak the pressure falls to 1.15 atm 1 hour later what is the leak rate in molecules/second?
Overview of the symbolic interactionist perspective : Provide an overview of the "symbolic interactionist" perspective in sociology - what are its main ideas, how does it differ from other sociological approaches
Denotational semantics : The text describes a denotational semantics for the simple imperative language given by the grammar
Calculate the entropy change for each of the following : 10g of steam at l00°C and a pressure of one atmosphere condensing into water at the same temperature and pressure. (The latent heat of vaporization of water is 22571 Jg^-1).
Problem regarding the order of evaluation : In pure lambda calculus, the order of evaluation of subexpressions does not effect the value of an expression. The same is true for pure Lisp: if a pure Lisp expres- sion has a value under the ordinary Lisp interpreter, then changing the order of ..
What are your thoughts about the aim : What are your thoughts about the aim, results, and implications of the study in terms of the author's efforts to understanding and assessing the identified domains of sexual values highlighted in the study
How many photons are incident on surface breast tissue : The entrance exposure during a mammography examination is 100mR. Suppose the photon bean consists of photons each of energy 20 keV. How many photons are incident on a 1 cm^2 surface of breast tissue?
What is the average molar specific heat in this range : The molar specific heat of many materials at low temperatures is found to obey the Debye law C_v = A[T/theta]^3 where A is a constant equal to 1.94 x 10^3 Jmol^-1K^-1 and with the Debye temperature theta taking different values for different mater..
Selling an old a car : John called you late on Friday afternoon with a simple question. He is considering selling an old a car and wants to know what the tax implications will be.

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Total cost of ownership

Total Cost of Ownership (TCO) and return on Investment (ROI) - analyze the advantages and disadvantages

  Part of your first project

On completion of this course you are hired by the company Tickets R Us. Part of your first project is to develop an application to assist with the selling of tickets. After discussing with your client

  Discuss how the business requirements drove the system

Discuss how the business requirements drove the system's initial development. Describe the type and basic uses of the system, how the system has helped the organization, and any likely future development plans.

  In which case there are no pricing changes

Finally, your management-side software should write to a file the status of the reservations; that is, which house is rented to whom, when, and for what price.

  Find a solution to storage dilemma

Mr Green owns ABC Music, which is a shop that sells music CD's to customers. Currently sales data is stored using a paper based system and Mr Green is running out of room to store ABC's sales records. Mr Green has approached you to find a solu..

  Design a wan replication topology

Design a WAN Replication Topology

  Managing the development of large software systems

Write paper on managing the development of large software systems

  A speeder traveling 45 miles per hour

Police chase: A speeder traveling 45 miles per hour (in a 25 mph zone ) passes a stopped police car which immediately takes off after the speeder. If the police car speeds up steadily to 60 miles/hour in 10 seconds and then travels at a steady 60 mil..

  Find benefits of using the technology to support learning

The policy should include the Do's and Don'ts of computer and internet use as well as penalties that could be applied if the policy is breached.

  Explain ibm plan to give its it assets-intellectual property

Will IBM's plan to give away some of its IT assets and intellectual property also increase its support of open-source software products like Linux.

  Every programming language have several commonalities

The basics of every programming language have several commonalities

  Use a cluster architecture to provide rapid scalability

Describe how you might use a cluster architecture to provide rapid scalability for a Web-based company experiencing rapid growth?

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd