From: Cyber Surfer
Subject: Re: Quick Sort in LISP?
Date: 
Message-ID: <781370114snz@wildcard.demon.co.uk>
In article <··········@tools.near.net>
           ······@nic.near.net "Barry Margolin" writes:

> (defun sort-file (filename)
>   (let ((lines
>           (with-open-file (s filename)
>             (loop for line = (read-line s nil nil)
>                   while line collect line))))
>     (setq lines (sort lines #'string-<))
>     (mapc #'write-line lines)))

It could also be done using the series functions:

(defun sort-file (filename)
    (let ((lines (collect (scan-file filename #'read-line))))
        (mapc #'write-line (sort lines #'string-<))))

The series functions aren't a part of CL, of course, but they
can be found in the Lisp Repository.
-- 
"Internet? What's that?" -- Simon "CompuServe" Bates
http://cyber.sfgate.com/examiner/people/surfer.html

From: Fernando Mato Mira
Subject: ADVOC: SERIES (was: Quick Sort in LISP?)
Date: 
Message-ID: <370csg$2it@disunms.epfl.ch>
In article <············@wildcard.demon.co.uk>, ············@wildcard.demon.co.uk (Cyber Surfer) writes:

> The series functions aren't a part of CL, of course, but they
> can be found in the Lisp Repository.

Of course? I don't know why they have not been included, given:

>>>>
;Copyright Massachusetts Institute of Technology, Cambridge, Massachusetts.

;Permission to use, copy, modify, and distribute this software and its
;documentation for any purpose and without fee is hereby granted,
;provided that this copyright and permission notice appear in all
;copies and supporting documentation, and that the name of M.I.T. not
;be used in advertising or publicity pertaining to distribution of the
;software without specific, written prior permission. M.I.T. makes no
;representations about the suitability of this software for any
;purpose.  It is provided "as is" without express or implied warranty.
>>>>

So SERIES would not be a barrier for somebody trying to implement
a compliant CL compiler.

As of now, chances are SERIES will end up dying, as:
 a. CL implementors do not maintain, or try to improve the package.
 b. Few people care about taking the time to learn how to use it.
    a) and the fact that it is an add-on are probably the greatest
    reasons for this.

--
F.D. Mato Mira                           
Computer Graphics Lab    ········@epfl.ch
EPFL                     FAX: +41 (21) 693-5328
From: Barry Margolin
Subject: Re: ADVOC: SERIES (was: Quick Sort in LISP?)
Date: 
Message-ID: <3747ss$5o7@tools.near.net>
In article <··········@disunms.epfl.ch> ········@di.epfl.ch (Fernando Mato Mira) writes:
>In article <············@wildcard.demon.co.uk>, ············@wildcard.demon.co.uk (Cyber Surfer) writes:

>> The series functions aren't a part of CL, of course, but they
>> can be found in the Lisp Repository.

>Of course? I don't know why they have not been included, given:
...
>So SERIES would not be a barrier for somebody trying to implement
>a compliant CL compiler.

It had nothing to do with implementation ease.  The Series facility wasn't
included in pANS CL for various reasons:

1) It wasn't in widespread use, so we weren't sure it was appropriate to
standardize it at the time that it was proposed to us.  To the extent
possible, a standards committee's job is to codify common practice, not
introduce major new functionality (CLOS and the condition system were
exceptions, explicitly identified in the X3J13 charter).

2) The specification was in flux, as it was being merged with the
Iterate/Gather facility.

>As of now, chances are SERIES will end up dying, as:
> a. CL implementors do not maintain, or try to improve the package.
> b. Few people care about taking the time to learn how to use it.
>    a) and the fact that it is an add-on are probably the greatest
>    reasons for this.

Documentation of Series was included in CLtL2 *specifically* to encourage
people to use it.  There are lots of things in many CL implementations that
aren't in the pANS.  The standard should not be viewed as *limiting*
implementors.

Furthermore, the availability of a free, portable implementation means that
users aren't dependent on the vendors to provide this facility.
-- 

Barry Margolin
BBN Internet Services Corp.
······@near.net
From: Fernando Mato Mira
Subject: Re: ADVOC: SERIES (was: Quick Sort in LISP?)
Date: 
Message-ID: <376m48$cv@disunms.epfl.ch>
In article <··········@tools.near.net>, ······@nic.near.net (Barry Margolin) writes:

> Documentation of Series was included in CLtL2 *specifically* to encourage
> people to use it.  There are lots of things in many CL implementations that
> aren't in the pANS.  The standard should not be viewed as *limiting*
> implementors.
> 
> Furthermore, the availability of a free, portable implementation means that
> users aren't dependent on the vendors to provide this facility.

I know, but I recall somebody talking about an application written using
SERIES that was `a dog to optimize'. Have you looked at the source code?
If somebody here could explain all that frag stuff that would be most useful.

-- 
F.D. Mato Mira           http://ligwww.epfl.ch/matomira.html                  
Computer Graphics Lab    ········@epfl.ch 
EPFL                     FAX: +41 (21) 693-5328
From: Cyber Surfer
Subject: Re: ADVOC: SERIES (was: Quick Sort in LISP?)
Date: 
Message-ID: <781646152snz@wildcard.demon.co.uk>
In article <··········@disunms.epfl.ch>
           ········@di.epfl.ch "Fernando Mato Mira" writes:

> Of course? I don't know why they have not been included, given:

I don't know either, but that's what I recall reading in c.l.l.

> So SERIES would not be a barrier for somebody trying to implement
> a compliant CL compiler.

I know. That's why I was plugging the series functions. ;-)
 
> As of now, chances are SERIES will end up dying, as:
>  a. CL implementors do not maintain, or try to improve the package.
>  b. Few people care about taking the time to learn how to use it.
>     a) and the fact that it is an add-on are probably the greatest
>     reasons for this.

Yet another reason for me plugging them. I'd much rather SCAN and
COLLECT than LOOP. I hope we've sparked a little more interest in
series functions.
-- 
"Internet? What's that?" -- Simon "CompuServe" Bates
http://cyber.sfgate.com/examiner/people/surfer.html