In article <CADow0CrM=mrumuute11zxgt594sz41pappyg--y+sbb8jzq...@mail.gmail.com>, Nikodemus Siivola <nikode...@random-state.net> wrote:
> On 25 April 2012 15:30, Nikodemus Siivola <nikode...@random-state.net> wrote: > > >> CL-UTILITIES calls this function EXTREMUM. (It also provides a couple > >> of more functions along the lines to cover some edge cases.) > > > > Pushed a version. Can you verify that it is what you wanted, and > > performs acceptably? > > So, what about the NO-EXTREMUM thing? > > I think it's good that the behaviour specified, instead of depending > on the PREDICATE and REDUCE, but an an interface NO-EXTREMUM + > CONTINUE is terrible: unless you handle the error right around the > call site, it's pointless, since no-one higher up the call stack can > know for sure where the error came from. At the call site it is overly > verbose and inefficient: > > (handler-bind ((no-extremum #'continue)) > (extremum ...)) > > I would much like to remove mention of the restart from the docstring, > and add &KEY DEFAULT instead: > > (extremum ... :default nil) > > would provide the same behaviour as invoking CONTINUE. Since you > obviously actually use this thing, any comments? I agree it's pointless. Why not just return NIL? (Or possibly (values <element> T) in case an extremum was found.) FIND, FIND-IF just return NIL, too, never minding the ambiguity. And EXTREMUM can be thought of a special case of FIND. T _______________________________________________ alexandria-devel mailing list alexandria-devel@common-lisp.net http://lists.common-lisp.net/cgi-bin/mailman/listinfo/alexandria-devel