I am trying to go through exercises of book SICM using the provided scheme code, however I could not figure out the reason for the error, I am quite novice in Scheme so can any one tell what am I missing here?
(define q (up (literal-function 'x)))
; This runs fine
(define ((Lagrangian-unknown m k) q) (+ (* 1/2 m (coordinate q) (coordinate q) ) (* 1/2 k (coordinate q) (coordinate q)) ))
(show-expression ((Lagrangian-unknown 'm 'k) ((Gamma q) 't)) ))
; This gives error
(define ((Lagrangian-unknown m k) q) (+ (* 1/2 m (coordinate q) (coordinate q) ) (* 1/2 k (coordinate q) ) ))
(show-expression ((Lagrangian-unknown 'm 'k) ((Gamma q) 't)) ))
In second iteration where I have just removed one term, I get following error
;Generic operator inapplicable: #[compiled-closure 12 (lambda "ghelper" #x3) #x625 #x2291fd5 ...] + (#(...) (*number* ...))
;To continue, call RESTART with an option number:
; (RESTART 1) => Return to read-eval-print level 1.