Re: argmax



Den Thu, 28 Feb 2008 20:22:33 +0200 skrev Alex Mizrahi:

i suspect i'm not the only one doing such macro, but i'm not able to
find any of them, and don't even know how it could be called.. something
tells me that fancy LOOP substitutions like ITERATE have this built-in,
but it would be overkill to use ITERATE just for this thing. also, with
my macro CHECK is lexical function, so it can be used in fairly complex
cases -- passed to other functions etc.

Indeed, ITERATE has MAXIMIZING/MINIMIZING clauses just for that. I
wouldn't say that switching is an overkill -- I find ITERATE much more
readable (thanks to more lispy syntax), and in general, a bit more
predictable than LOOP. It's also extensible, so you could add a new
clause, say, OPTIMIZING expr BY, so that it'd work like all built-in
clauses.

Cheers,
Maciej
.



Relevant Pages

  • Re: for (var i in o): hidden properties of objects?
    ... gives some properties of obj, ... "A for...in loop does not iterate over built-in properties. ... These include all built-in methods of objects, such as String's indexOf method or Object's toString method. ...
    (comp.lang.javascript)
  • Re: is it ok to (setf (get :const :prop) :val)?
    ... I'd like to use both cl-utilities and iterate. ... cl-utilities define collecting macro. ... I found it possible to make iterate to use keywords ... for clauses instead of exported symbols from iterate package via ...
    (comp.lang.lisp)
  • Re: Confused about packages
    ... #:iterate) in the loaded "iterate" files? ... In ITERATE, unlike LOOP ketwords, the clauses ... Note that the syntax marking words in the clauses ... Those symbols weren't listed in the:EXPORT list of the interate package ...
    (comp.lang.lisp)
  • Re: Confused about packages
    ... shouldn't that happen automatically when there is (in-package ... #:iterate) in the loaded "iterate" files? ... In ITERATE, unlike LOOP ketwords, the clauses ... Note that the syntax marking words in the clauses ...
    (comp.lang.lisp)