actually i know what is eating it...the real question is...why?
here's the situation:
i'm taking a computer science course in which we are starting out learning LISP and SCHEME. all of this i can do through the terminal on my powermac, i just needed to download the STK interpreter. the other night when i was working on a definition for deriving cubed roots ... here's the working code that i will be handing in for my assignment:
(define (cube-root x)
(define (cube x)
(* x x x))
(define (improve y x)
(/ (+ (/ x (* y y)) (* 2 y)) 3))
(define (good-enough? guess x)
(< (abs (- (cube guess) x)) 0.001))
(define (cbrt-iter guess x)
(if (good-enough? guess x)
guess
(cbrt-iter (improve guess x)
x)))
(cbrt-iter 1.0 x))
the first time i wrote this, i messed up and had an extra formula inside, which made the procedure run forever, never finding a (good-enough?) answer. when this happens, STK will lock out not letting me do anything in that xterm. so i terminated the terminal window and opened a new one...i did this a few times while trying to find out what the problem was (probably about 4-5 times). i noticed all 1024mb of RAM on my machine was being used (via Aquamon). i opened the process viewer to notice that about half of my processor and 3/4 of my ram was beig taken up by the STK modules still, even after quitting out of the Terminal program?
so now i beg the question:
why won't the system stop the operation?
i had to restart to get my RAM back
here's the situation:
i'm taking a computer science course in which we are starting out learning LISP and SCHEME. all of this i can do through the terminal on my powermac, i just needed to download the STK interpreter. the other night when i was working on a definition for deriving cubed roots ... here's the working code that i will be handing in for my assignment:
(define (cube-root x)
(define (cube x)
(* x x x))
(define (improve y x)
(/ (+ (/ x (* y y)) (* 2 y)) 3))
(define (good-enough? guess x)
(< (abs (- (cube guess) x)) 0.001))
(define (cbrt-iter guess x)
(if (good-enough? guess x)
guess
(cbrt-iter (improve guess x)
x)))
(cbrt-iter 1.0 x))
the first time i wrote this, i messed up and had an extra formula inside, which made the procedure run forever, never finding a (good-enough?) answer. when this happens, STK will lock out not letting me do anything in that xterm. so i terminated the terminal window and opened a new one...i did this a few times while trying to find out what the problem was (probably about 4-5 times). i noticed all 1024mb of RAM on my machine was being used (via Aquamon). i opened the process viewer to notice that about half of my processor and 3/4 of my ram was beig taken up by the STK modules still, even after quitting out of the Terminal program?
so now i beg the question:
why won't the system stop the operation?
i had to restart to get my RAM back