From: Kirk Job Sluder
Subject: stupid clisp question
Date: 
Message-ID: <87ekcfhkud.fsf@debian.kirkjobsluder.is-a-geek.net>
I have a script that includes this code:

;;;------------------------
(defun write-output (outfile)
(with-open-file (out outfile :direction :output 
		     :if-exists :supersede
		     )
  ;;print the header
  (format out "~a~c~a~c~a~%" "userID" #\Tab "gender" #\Tab "chatcount")
  (loop for k being the hash-keys in *postcount-hash* using (hash-value v)
	do (format out "~a~c~a~c~a~%"
		   k
		   #\Tab
		   (gethash k *gender-hash*)
		   #\Tab
		   v))))


(read-transcript "/dev/stdin")
(write-output "/dev/stdout")
(quit)

;;;---------------------

Now when I use sbcl I get the expected output:

>sbcl --noinform --load chat-gender-postcount.lisp < marchChat_head.txt

userID  gender  chatcount
2628    m       1
...
--------

clisp is a different story:

>clisp -q -q -E ISO-8859-1 chat-gender-postcount.lisp < marchChat_head.txt

; loading system definition from /usr/share/common-lisp/systems/split-sequence.asd into #<PACKAGE
;   ASDF5074>
; registering #<SYSTEM :SPLIT-SEQUENCE #x203F6906> as SPLIT-SEQUENCE

; loading system definition from /usr/share/common-lisp/systems/split-sequence.asd into #<PACKAGE
;   ASDF5074>
; registering #<SYSTEM :SPLIT-SEQUENCE #x203F6906> as SPLIT-SEQUENCE

0 errors, 0 warnings
userID  gender  chatcount
...
----

Worse, redirecting the output to a file results in a file containing
just the asdf load messages.

I googled around on this and was unable to find a solution.  I don't
mind using sbcl, but it is interesting.  How can I supress the info 
messages? And why is clisp not sending the output of (write-output) to 
stdout?


-- 
Kirk Job-Sluder
"The square-jawed homunculi of Tommy Hilfinger ads make every day an
existential holocaust."  --Scary Go Round

From: Sam Steingold
Subject: Re: stupid clisp question
Date: 
Message-ID: <u4qdbgqc4.fsf@gnu.org>
> * Kirk Job Sluder <····@wbofyhqre.arg> [2005-05-10 02:31:58 +0000]:
>
> I have a script that includes this code:
>
> ;;;------------------------
> (defun write-output (outfile)
> (with-open-file (out outfile :direction :output 
> 		     :if-exists :supersede
> 		     )
>   ;;print the header
>   (format out "~a~c~a~c~a~%" "userID" #\Tab "gender" #\Tab "chatcount")
>   (loop for k being the hash-keys in *postcount-hash* using (hash-value v)
> 	do (format out "~a~c~a~c~a~%"
> 		   k
> 		   #\Tab
> 		   (gethash k *gender-hash*)
> 		   #\Tab
> 		   v))))
>
>
> (read-transcript "/dev/stdin")
> (write-output "/dev/stdout")

this doesn't look like a good idea (this is not portable between UNIX
systems and not portable between CL implementations).

why not read from *STANDARD-INPUT* and write to *STANDARD-OUTPUT*?

> clisp is a different story:
>
>>clisp -q -q -E ISO-8859-1 chat-gender-postcount.lisp < marchChat_head.txt
>
> ; loading system definition from
> ; /usr/share/common-lisp/systems/split-sequence.asd into #<PACKAGE
> ;   ASDF5074>
> ; registering #<SYSTEM :SPLIT-SEQUENCE #x203F6906> as SPLIT-SEQUENCE
>
> ; loading system definition from
> ; /usr/share/common-lisp/systems/split-sequence.asd into #<PACKAGE 
> ;   ASDF5074>
> ; registering #<SYSTEM :SPLIT-SEQUENCE #x203F6906> as SPLIT-SEQUENCE

these are not CLISP messages.
I suspect they are issued by ASDF.

> 0 errors, 0 warnings

this is what CLISP prints at the end of a compilation unit to
*ERROR-OUTPUT* when *COMPILE-VERBOSE* is non-NIL.
actually, "-q -q" sets *COMPILE-VERBOSE* to NIL in the CVS HEAD
(but I don't think it does that in the latest release).

> Worse, redirecting the output to a file results in a file containing
> just the asdf load messages.

I have no idea about how shell redirection interacts with /dev/stdio and
with CLISP stream setup.

> How can I supress the info messages?

look at the ASDF sources/docs.

> And why is clisp not sending the output of (write-output) to stdout?

because you are not using *standard-output*

-- 
Sam Steingold (http://www.podval.org/~sds) running w2k
<http://ffii.org/> <http://www.iris.org.il> <http://www.dhimmi.com/>
<http://pmw.org.il/> <http://www.palestinefacts.org/>
Live Lisp and prosper.
From: Kirk Job Sluder
Subject: Re: stupid clisp question
Date: 
Message-ID: <87vf5q78t4.fsf@debian.kirkjobsluder.is-a-geek.net>
Thanks, this suggestion helped.

-- 
Kirk Job-Sluder
"The square-jawed homunculi of Tommy Hilfinger ads make every day an
existential holocaust."  --Scary Go Round
From: Pascal Bourguignon
Subject: Re: stupid clisp question
Date: 
Message-ID: <874qdbv7qn.fsf@thalassa.informatimago.com>
Kirk Job Sluder <····@jobsluder.net> writes:

> I have a script that includes this code:
>
> ;;;------------------------
> (defun write-output (outfile)
> (with-open-file (out outfile :direction :output 
> 		     :if-exists :supersede
> 		     )
>   ;;print the header
>   (format out "~a~c~a~c~a~%" "userID" #\Tab "gender" #\Tab "chatcount")
>   (loop for k being the hash-keys in *postcount-hash* using (hash-value v)
> 	do (format out "~a~c~a~c~a~%"
> 		   k
> 		   #\Tab
> 		   (gethash k *gender-hash*)
> 		   #\Tab
> 		   v))))
>
>
> (read-transcript "/dev/stdin")
> (write-output "/dev/stdout")
> (quit)
>
> ;;;---------------------
>
> Now when I use sbcl I get the expected output:
>
>>sbcl --noinform --load chat-gender-postcount.lisp < marchChat_head.txt
>
> userID  gender  chatcount
> 2628    m       1
> ...
> --------
>
> clisp is a different story:
>
>>clisp -q -q -E ISO-8859-1 chat-gender-postcount.lisp < marchChat_head.txt
>
> ; loading system definition from /usr/share/common-lisp/systems/split-sequence.asd into #<PACKAGE
> ;   ASDF5074>
> ; registering #<SYSTEM :SPLIT-SEQUENCE #x203F6906> as SPLIT-SEQUENCE
>
> ; loading system definition from /usr/share/common-lisp/systems/split-sequence.asd into #<PACKAGE
> ;   ASDF5074>
> ; registering #<SYSTEM :SPLIT-SEQUENCE #x203F6906> as SPLIT-SEQUENCE
>
> 0 errors, 0 warnings
> userID  gender  chatcount
> ...
> ----
>
> Worse, redirecting the output to a file results in a file containing
> just the asdf load messages.
>
> I googled around on this and was unable to find a solution.  I don't
> mind using sbcl, but it is interesting.  How can I supress the info 
> messages? And why is clisp not sending the output of (write-output) to 
> stdout?

Use: (SETF *LOAD-VERBOSE* NIL) 

Note: ASDF might rebind it to T. In that case you'll have to check
ASDF sources and: ASDF::*VERBOSE-OUT*


-- 
__Pascal Bourguignon__                     http://www.informatimago.com/
Grace personified,
I leap into the window.
I meant to do that.
From: Kirk Job Sluder
Subject: Re: stupid clisp question
Date: 
Message-ID: <87zmv278u5.fsf@debian.kirkjobsluder.is-a-geek.net>
Pascal Bourguignon <···@informatimago.com> writes:

> Use: (SETF *LOAD-VERBOSE* NIL) 
> 
> Note: ASDF might rebind it to T. In that case you'll have to check
> ASDF sources and: ASDF::*VERBOSE-OUT*

Actually, it required this (which was a bit harder to find than it
really should have been.)

(asdf:operate 'asdf:load-op 'split-sequence :verbose nil)

> 
> 
> -- 
> __Pascal Bourguignon__                     http://www.informatimago.com/
> Grace personified,
> I leap into the window.
> I meant to do that.

-- 
Kirk Job-Sluder
"The square-jawed homunculi of Tommy Hilfinger ads make every day an
existential holocaust."  --Scary Go Round