chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Chicken-users] Re: Adding (system->string) somewhere


From: Ivan Shmakov
Subject: [Chicken-users] Re: Adding (system->string) somewhere
Date: Tue, 15 Jan 2008 02:32:17 +0600
User-agent: Gnus/5.110006 (No Gnus v0.6) Emacs/21.4 (gnu/linux)

>>>>> Zbigniew  <address@hidden> writes:

 >> I am using the following code, which just takes a single string:
 >> (define (system->string cmd) (string-chomp (with-input-from-pipe cmd
 >> read-all)))

 > First, the string-chomp is pointless unless you're reading only one
 > line.  Why chomp just the last newline of a multi-line string?

        Believe me or not, but the POSIX Shell behaves exactly that way.
        Consider using `print' on the result:

(print (system-string "ls"))

        I'm not sure that one should mimic the Shell behaviour in
        Scheme, though.

[...]





reply via email to

[Prev in Thread] Current Thread [Next in Thread]