Re: Ugly loop
- From: Marco Antoniotti <marcoxa@xxxxxxxxxx>
- Date: Tue, 07 Jun 2005 08:15:02 -0400
Marcin 'Qrczak' Kowalczyk wrote:
Ron Garret <rNOSPAMon@xxxxxxxxxxx> writes:
To generalize this: IMO, the main shortcoming of LOOP (and the way it most fails to be sufficiently lispish) is that it isn't extensible.
DO isn't extensible either. For that matter, neither is LAMBDA.
And some find a pity that they can't use other pattern matching constructs in LAMBDA than those predesigned. Well, often this requires changing the overall structure too, c.f. CASE-LAMBDA with many clauses; patterns make more sense when you can specify what to do when matching fails, so in the original lambda there is little to extend.
A shameless plug is in order here: http://common-lisp.net/project/cl-unification
Cheers -- Marco
There is even less to extend in DO because it's quite simple. And if there was, it's simple enough to be reimplemented.
LOOP is not simple, and there are useful ways in which it could be extended: supporting more sequence types. For example arithmetic sequences, virtual concatenation of sequences, sequences with a finite length and the same value as each element, or lazily delivered results of a DB query.
Lisp doesn't provide mechanisms to view such non-standard sequence as a single value from which LOOP or other iteration constructs take elements. The programmer must find and directly use a low level iterator-like interface.
Which gives me the chance to add another shameless plug http://common-lisp.net/project/cl-enumeration
:)
Cheers -- Marco
.
- References:
- Ugly loop
- From: Ulrich Hobelmann
- Re: Ugly loop
- From: Matthias Buelow
- Re: Ugly loop
- From: Ulrich Hobelmann
- Re: Ugly loop
- From: Matthias Buelow
- Re: Ugly loop
- From: Pascal Costanza
- Re: Ugly loop
- From: Espen Vestre
- Re: Ugly loop
- From: Paul Dietz
- Re: Ugly loop
- From: Ron Garret
- Re: Ugly loop
- From: Marcin 'Qrczak' Kowalczyk
- Ugly loop
- Prev by Date: Re: ANSI question (arose from the wordcount thread)
- Next by Date: Re: Regarding Lisp/Scheme
- Previous by thread: Re: Ugly loop
- Next by thread: Re: Ugly loop
- Index(es):
Relevant Pages
|