• Re: Autolisp user wants to know about Lisp

    From B. Pym@21:1/5 to All on Fri Jun 20 22:21:09 2025
    (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")

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)