macro problem

"goobamarino" <[email protected]> Mon, 21 Apr 2003 00:39:00 -0000
Newsgroups gmane.lisp.corman
Message-ID <[email protected]>
Corman 2.01

The example for With-open-stream from the Hyperspec throws an error:


   (with-open-stream (s (make-string-input-stream "1 2 3 4"))
       (+ (read s) (read s) (read s)))

;;; An error occurred in function #< COMPILED-FUNCTION: #x11A7CC0 >:
;;; Error: The function S is undefined
;;; Entering Corman Lisp debug loop. 
;;; Use :C followed by an option to exit. Type :HELP for help.
;;; Restart options:
;;; 1   Abort to top level.

If I define a replacement for the macro the example seems to work:

    (defmacro with-open-stm ((var stm) &rest forms)
        `(let ((,var ,stm))
             (unwind-protect                 
                ,@forms
                (close ,stm))))

>> WITH-OPEN-STM



    (with-open-stm (s (make-string-input-stream "1 2 3 4"))
        (+ (read s) (read s) (read s)))

>> 6

Is this in the next patch?


------------------------ Yahoo! Groups Sponsor ---------------------~-->
Get 128 Bit SSL Encryption!
http://us.click.yahoo.com/W7NydA/hdqFAA/VygGAA/SyjtlB/TM
---------------------------------------------------------------------~->

To unsubscribe from this group, send an email to:
[email protected]

 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/