Path: news.eternal-september.org!eternal-september.org!.POSTED!not-for-mail From: "B. Pym" Newsgroups: comp.lang.lisp Subject: Re: Autolisp user wants to know about Lisp Date: Fri, 20 Jun 2025 22:21:09 -0000 (UTC) Organization: A noiseless patient Spider Lines: 19 Message-ID: <1034msk$9k03$1@dont-email.me> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Injection-Date: Sat, 21 Jun 2025 00:21:09 +0200 (CEST) Injection-Info: dont-email.me; posting-host="aa632a0fd11017dc33a603ef85fe3ef5"; logging-data="315395"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19JwGoqd8rUgq5cb86jidI0" User-Agent: XanaNews/1.18.1.6 Cancel-Lock: sha1:NCa3kfobJB+MTcoqjzQxkpt8BnI= > (defun sort-file-lines (input-file output-file) > (with-open-file (instream input-file :direction :input) > (with-open-file (outstream output-file :direction :output) > (dolist (line (sort (loop for line = (read-line instream nil nil) > while line > collect line) > #'string-lessp)) > (write-line line outstream))))) Gauche Scheme: (use file.util) (define (sort-file-lines in-file out-file) (with-output-to-file out-file (lambda () (for-each print (sort (file->string-list in-file)))))) (sort-file-lines "data.bak" "junk")