Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the meaning of this Scheme

Tags:

scheme

I am new to Scheme, by looking at the Exercise 1.5 of SICP, what is the meaning/usage of this expression?

(define (p) (p))

Thanks!

like image 399
nandin Avatar asked May 27 '10 20:05

nandin


People also ask

What is the full meaning of scheme?

Definition of scheme (Entry 1 of 2) 1 : a plan or program of action especially : a crafty or secret one. 2 : a systematic or organized configuration : design color scheme. 3 : a concise statement or table : epitome.

What is a scheme example?

The definition of a scheme is a plot or a plan to achieve some action. An example of a scheme is a plot to defraud your boss.

Why does scheme mean?

Meaning of scheme in English. an organized plan for doing something, especially something dishonest or illegal that will bring a good result for you: He has a hare-brained/crazy scheme for getting rich before he's 20.

What's the word for scheme?

Some common synonyms of scheme are design, plan, plot, and project. While all these words mean "a method devised for making or doing something or achieving an end," scheme stresses calculation of the end in view and may apply to a plan motivated by craftiness and self-interest.


1 Answers

(define (p) (p))

The above defines a function p that takes no arguments and calls itself recursively (infinitely).

The exercise 1.5 is about applicative-order vs normal-order evaluation.

(define (test x y)
  (if (= x 0)
       0
       y))

(test 0 (p))

In applicative-order all arguments are evaluated and then they are applied to the test, so the program will freeze if the interpreter uses that kind of evaluation in this specific case.

like image 53
Nick Dandoulakis Avatar answered Oct 27 '22 18:10

Nick Dandoulakis