What part of this code causes 100% cpu usage when it is running?
(defun sqrt-advisor ()
(loop (format t "~&Number: ")
(let ((n (parse-integer (read-line) :junk-allowed t)))
(when (not n) (return))
(format t "~&The square root of ~D is ~D.~%" n (sqrt n)))))
If this matters, I am using:
ACL 7.0 trial on a Dell XP laptop
512 megs mem
-newbie
···············@yahoo.com writes:
> Alan Manuel K. Gloria wrote:
>> read-line?
>
> Yes, the original poster should post the code for read-line.
Is this a joke? READ-LINE is part of Common Lisp.
Bill
I posed the same question to Franz, Inc., and received this reply:
-------
Re: [spr31519] what causes 100% cpu usage?
Further research shows this only happens on Windows when running the
IDE (if you bring up the console window and try it, you do not see the
100% cpu usage). This is then an IDE problem and we will likely
address it soon.
David Margolies
Franz Inc.
--------
The code sample comes straight from the Common Lisp Hyperspec for
"Loop" at http://www.lisp.org/HyperSpec/Body/mac_loop.html
As for "read-line", it can be also be found in the Hyperspec.
http://www.lisp.org/HyperSpec/Body/fun_read-line.html