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!
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.
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.
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.
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.
(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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With