(define (procedere1) (lambda () 2))
(define procedure2 (lambda () 2))
They both can be compiled. But I am confused about the difference between above two procedures.
The first one is a procedure that returns a procedure. The second one is a procedure that returns the number 2.
In particular, the first one is equivalent to the following:
(define procedure1
(lambda ()
(lambda () 2)))
In general
(define (name arg1 arg2 arg3 ...)
body)
is shorthand for
(define name
(lambda (arg1 arg2 arg3 ...)
body))
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