[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Predicate for true lists

From: Drew Adams
Subject: RE: Predicate for true lists
Date: Fri, 6 Jul 2018 11:00:43 -0700 (PDT)

> > > Do we really want this usage of the function as a predicate?  I find
> > > this slightly unnatural, and also not future-proof enough, because
> > > you rely on the checks 'length' does internally.  If the internals of
> > > 'length' change one day, this predicate usage will collapse like a
> > > house of cards.  Would it make more sense to have a separate
> > > predicate?
> >
> > IIRC, the main motivation for adding this function was
> > to provide a predicate for testing properness.
> Then I'd prefer calling the function proper-list-p (and returning the
> list length when it's a proper list) than the other way around.

Then discoverability of the use for length is reduced.

Just define it once (one function), using whichever name
is preferred, AND alias the other name to the same function.

That will help users discover it for both uses.
And of course the doc string should point out both uses.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]