Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 869725
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T10:21:20+00:00 2026-05-15T10:21:20+00:00

For the 1st example given on site: View-Site , my understanding is that normal

  • 0

For the 1st example given on site: View-Site, my understanding is that normal order evaluates to [6;1;1] and applicative order evaluates to [6;2;2]

Can anyone please confirm my assessment?

Regards,
darkie

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T10:21:20+00:00Added an answer on May 15, 2026 at 10:21 am

    Ok, let’s go through the steps of evaluating (cons res v) with normal-order evaluation:

    v has been defined as (cons a (cons b ’())), so we have cons res (cons a (cons b ’())). res is defined as (foo ...), so we have

    (cons (foo (begin (set! a (+ a 1)) a)
               (begin (set! b (* b 2)) b))
          (cons a (cons b ’())))
    

    Lastly foo x y is defined as (+ x y y), so by substituting (begin (set! a (+ a 1)) a) for x and (begin (set! b (* b 2)) b) for y, we get:

    (cons (+ (begin (set! a (+ a 1)) a)
             (begin (set! b (* b 2)) b)
             (begin (set! b (* b 2)) b))
          (cons a (cons b ’())))
    

    So now let’s evaluate this: To get the result of cons, we first need to evaluate its first argument, (+ ...). So we first need to evaluate the first argument of + which is (begin (set! a (+ a 1)) a). This evaluates to 2, so the value of a is now 2 and the first argument to + is also 2. Now we do the same thing with the second argument. This also evaluates to 2 and sets b to 2. The third argument is (begin (set! b (* b 2)) b) again, so the value of b is now 4 and the third argument is 4. So the first argument to cons is the result (+ 2 2 4), which is 8 and the values of a and b are 2 and 4.

    Now we need to evaluate the second argument, (cons a (cons b ’())). So since the value of a and b are 2 and 4, the end result is (8 2 4).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Example: given a continuous list of date range List[0] = from 2001 Jan 01
Given that you have found a process that you wish to execute a function
I have a file that has 2 columns as given below.... 101 6 102
Given that a certain business is open 8am-5pm, what is the best way to
1st phase I have a problem shutting down my running JBoss instance under Eclipse
1st post on stackoverflow, hope to have great feedback :) I'm currently trying to
Ok thanks for the 1st guy I found the code. Machine.Migrations: I mean, the
I'm about to enter the 1st phases of designing a commodities trading application. A
I'm working on my 1st project using MS Unity IoC framework. If I have
Consider the following 2 scenarios: Scenario 1). Today is May 1st 2012, and Scenario

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.