Re: Reading pipe from *standard-input*?
Sam Steingold <[email protected]> Thu, 23 Mar 2017 10:59:10 -0400
| Newsgroups | gmane.lisp.clisp.general |
|---|---|
| Message-ID | <[email protected]> |
Hi, > * Jean Louis <[email protected]> [2017-03-23 17:42:38 +0300]: > > I really need a clue how to read a pipe from *standard-input*. I am not sure what this means. $ cat foo | clisp should work just fine; reading *standard-input* will give you the content of foo. > I need to accept *standard-input*. I don't understand what you mean, sorry. > I was testing prior to this email and now I don't see any errors, > while there were some errors with the output previously. all errors should be copied into the email verbatim. > (defun main nil It is extremely unidiomatic to use "nil" for arglist. `(defun main () ...)` looks much better. > (let ((input (with-open-stream (str *standard-input*) > (alexandria.0.dev:read-stream-content-into-string str)))) why not just read from *standard-input* ? > (format t (alexandria.0.dev:read-file-into-string tmp-md :external-format "utf-8"))) it's a very bad idea to pass a string to format as the format string. you will get an error if your (alexandria...) returns a string containing "~". You should use princ or at least (format t "~A" (alexandria...)) Good luck. -- Sam Steingold (http://sds.podval.org/) on darwin Ns 10.3.1504 http://steingoldpsychology.com http://www.childpsy.net http://camera.org http://jij.org http://no2bds.org http://americancensorship.org Vegetarians eat Vegetables, Humanitarians are scary. ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________ clisp-list mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/clisp-list