SICP: applicative or normal order evaluation I'm trying to solve Problem 1.5 from SICP book.
Consider the following definitions: 

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


The question is, what would happen if (test 0 (p)) is interpreted in applicative vs normal order.

(Applicative: evaluate all the arguments and then apply the operand. Normal: fully expand the expression and then evaluate it.)

I intuitively feel that the answer must be that one of the two gets into an infinite loop, while the other stops due to the fact that if is a special form, which does not evaluate the else-branch if the then-branch is already evaluated.

Question is: will this happen? And which one will not get into an infinite loop and why?

My reasoning is the following:

Applicative: tries to evaluate all the arguments first.

(test 0 (p)) evaluates 0 to 0 and (p) to (p).

Thus the next step:

(test 0 (p))  --> same as above, we are in an endless loop.

Normal: fully expands the expression

(test 0 (p))  --> expanded to:

(if (= 0 0) 0 (p))  --> expanded to:

(if (= 0 0) 0 (p))  --> ... (it got in an infinite loop too)

OR: does it stop at this point, because if is a special form? (Even though this is true, if we stop now, we did not really expand everything first, as we were supposed...)
This is how I understand it:
; Normal
(test 0 (p))
(if (= 0 0) 0 (p)))

Normal order continues expanding because it hasn't yet reached an expression with only primitives, which recurses into an infinite loop replacing (p) by (p).
; Applicative
(test 0 (p))
(if (= x 0) 0 y))
(if (= 0 0) 0 y))

Applicative order applies the procedure (the if predicate) to the arguments that are the values of its sub-expressions. Because if short-circuits, the expression reduces to #t before before evaluating sub-expression y.