Re: Ugly loop





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





.



Relevant Pages

  • Re: Ugly loop
    ... >> it most fails to be sufficiently lispish) is that it isn't extensible. ... There is even less to extend in DO because it's quite simple. ... LOOP is not simple, and there are useful ways in which it could be ... sequences, virtual concatenation of sequences, sequences with a finite ...
    (comp.lang.lisp)
  • Re: Book-able view of ID as speculative science
    ... >> interested in how pattern classification or pattern recognition is ... Many methods applied to the genome are ... > characteristics of massive amounts of genomic sequences currently ... > conventional SOM, on the basis of batch-learning SOM, for genome ...
    (talk.origins)
  • Re: I want to buy an NSG
    ... > 3) NSG must be capable of producing a different sequence when given a ... > different pattern number. ... > The sequences do not need to be the exact numbers shown above. ...
    (borland.public.delphi.thirdpartytools.general)
  • Re: Book-able view of ID as speculative science
    ... > is called "Pattern Recognition" by Theodoridis and Koutroumbas, ... > method of searching for something and have a good definition of what ... characteristics of massive amounts of genomic sequences currently ... Map (SOM), is an effective tool for clustering and visualizing ...
    (talk.origins)
  • Re: Fermats Last Theorem Near Misses
    ... >> pattern I can find. ... new family that generates sequences with fewer than a trillion digits ... 1st bug in MS win2k source code found after 20 minutes: ...
    (sci.math)