SICP Exercises (1)

Source: Internet
Author: User

<title>SICP Exercises (1)</title> SICP exercises (1) Table of Contents
    • 1.1.1 Evaluation
    • 2.1.2 Prefix form Conversion
    • 3.1.3 To find the sum of the larger two numbers
    • 4.1.4 Description Behavior
    • 5.1.5 Applicative order vs Normal Order
11.1 Evaluation21.2 Prefix form Conversion
(/(+ 5 4 (-2 (-3 (+ 6 (/4 5)))) 3 (-6 2) (-2 7))

My practice is to start from the inside out.

31.3 The sum of the larger two numbers
(define (f x y z)  (Cond ((and (<= x y) (<= x z)) (+ y z       )) ((and (<= y x) (<= y Z)) (+ x Z       )) (Else (+ x y))))   

Note that you must add the = number, otherwise when x=y=3, Z=6 will execute X+y

41.4 Description Behavior

When B is greater than 0 get--that is a-a or otherwise a+b

51.5 applicative order vs Normal Order

Applicative Order: (Test 0 (p)) (test 0 (p)) has been indefinitely looped down

Normal order: (Test 0 (P)) (if (= 0 0) 0 (p)) because 0 equals 0, it does not execute (p)

Author:lexnewgate

created:2016-01-02 Saturday 01:58

Emacs 24.5.1 (ORG mode 8.2.10)

Validate

SICP Exercises (1)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.