One paranthesis pair too much.
I recommend you to use automatic indentation in DrRacket for each argument in such more complicated expressions.
This is the correct version:
(equal? ((lambda (s z) (s 3 z)) + 0)
3)
;; #t
Note, the 3)
is exactly aligned to the ((lambda ...
, indicating it is at exactly the same level with the lambda-expression containing s-expression.
See what would have happened, if you would have started new line in DrRacket with the previous code, to specify and test that 3
is the second argument to equal?
:
(equal? (((lambda (s z) (s 3 z)) + 0)
3))
Do you see? The 3
is off by one position. It is not exactly aligned to the beginning of (((lambda ...
. But you would know, it should, if 3 and the lambda expression-bearing s-expression are at the same hierarchy level (like being arguments to the function equal?
).
That is why lispers swear by automatic-indentation-capable lisp editors. Because through such small, but important, hints the automatic indentation helps you to tame the parantheses.