Question pecific Problem with syntax ... "object not applicable" error 

Forum: Com Sci 12500, U Chicago, Autumn 2002, Discuss Classwork, old
Re: News Assignment #2, due Wednesday, 9 October (Mike O'Donnell)
Date: 2002, Oct 09
From: Ivan Beschastnikh <ivan@uchicago.edu>

I have a problem simply calling my procedures. Take the following example:

(carryon_number 0) ----> "end"
(carryon_number 1) ----> ;The object 0 is not applicable.
(carryon_number 1) ----> ;The object 2 is not applicable.
(carryon_number 1) ----> ;The object 4 is not applicable.

therefore repeated calls to the procedure with 1 as the
seconds argument (makes no diff what it is) ... returns
successive results incremented by 2. Note that the variables
runon and moveon do acquire new values appropriately. So
everything is fine except the error message ... which is
similiar to my other 2 functions....

WHat's the problem ????? Help plez


transcript:


(define runon 0)
(define moveon 0)
(define carryon_number
  (lambda (s)
    (if (<= s 0)
 "end"; Execute when s <= 0
(
  (set! runon (+ 2 runon))
 (set! moveon (+ 1 moveon))
 "abc"
;   (runon_number (- s 1))
;   (runon_number (- s 1))
;         (moveon_number (- s 1))
 ))))


Messages

1. Feedback Don't use set!! by Mike O'Donnell, 2002, Oct 09

to: "pecific Problem with syntax ... "object not applicable" error"