sicp-1-3-2-constructing-procedures-using-lambda
#lang racket ;;;;;;;;;; ;; 1.34 ;; ;;;;;;;;;; (define (f g) (g 2)) (f sqr) ;; 4 (f (lambda (z) (* z (add1 z)))) ;; 6 ;; (f f) reduces to (f 2) which reduces to (2 2) which produces an error because 2 ;; is not a procedure. ;; (f f) ;; application: not a procedure; ;; expected a procedure that can be applied to arguments ;; given: 2 ;; arguments...: ;; 2 ;; context...: ;; C:\Program Files\Racket\collects\racket\private\misc.rkt:87:7
Comments