Subject: [clisp-list] Break message

From: Leonardo Bitsch <[email-masked]>
Date: Wed, 17 Jan 2001 16:24:17 -0200 (EDT)

I' ve made this function to compile lisp code from a file and to write the
results in other files! In fact,  I want to write in the error file the
"break message" as in lisp prompt and not the error. How can I do this?
Thanks..

(defun lisp-call ()
;;open the files
(let ((is (open "file way/code" :direction :input))
      (os (open "file way/results" :direction :output))
      (es (open "file way/erros" :direction :output)))
;;write to files    
   (multiple-value-bind (a error)
        (ignore-errors (print (eval (read is)) os))
      (print error es))
    (close es)
    (close os)))
;;start function
(lisp-call)

---

From: Sam Steingold <[email-masked]>
Date: 17 Jan 2001 15:34:31 -0500

> * In message <[email-masked]>
> * On the subject of "[clisp-list] Break message"
> * Sent on Wed, 17 Jan 2001 16:24:17 -0200 (EDT)
> * Honorable Leonardo Bitsch <[email-masked]> writes:
>

1. you forgot to close `is'.  You might find the macro `with-open-file'
   useful.  Please see the CLHS.

2. what you probably want is to bind `*standard-output*',
   `*error-output*', and `*standard-input*'.  Please see the CLHS.

3. You might find the function `dribble' useful.  Please see the CLHS.

-- 
Sam Steingold (http://www.podval.org/~sds)
Support Israel's right to defend herself! <http://www.i-charity.com/go/israel>
Read what the Arab leaders say to their people on <http://www.memri.org/>
I haven't lost my mind -- it's backed up on tape somewhere.

---

From: Marco Antoniotti <[email-masked]>
Date: Thu, 18 Jan 2001 09:25:11 -0500

> X-Authentication-Warning: baker.lcmi.ufsc.br: dado owned process doing -bs
> From: Leonardo Bitsch <[email-masked]>
> Content-Type: TEXT/PLAIN; charset=US-ASCII
> Sender: [email-masked]
> Date: Wed, 17 Jan 2001 16:24:17 -0200 (EDT)
> Content-Length: 783
> 

(defun lisp-call ()
   (with-open-file (is "file way/code" :direction :input)
      (with-open-file (os "file way/results" :direction :output
                                             :if-exists :supersede)
         (with-open-file (es "file way/errors" :direction :output
                                               :if-exists :supersede)
            (multiple-value-bind (a error)
                (ignore-errors (print (eval (read is)) os))
              (print error es))))))

Cheers

-- 
Marco Antoniotti =============================================================
NYU Bioinformatics Group			 tel. +1 - 212 - 998 3488
719 Broadway 12th Floor                          fax  +1 - 212 - 995 4122
New York, NY 10003, USA				 http://galt.mrl.nyu.edu/valis
             Like DNA, such a language [Lisp] does not go out of style.
			      Paul Graham, ANSI Common Lisp