more build problems, STEP-FUN in LOOP must be a function



In article 
<8b356f880705041528g5cb52456sc88b4dd4b67efa53 at mail.gmail.com>,
 "Stavros Macrakis" <macrakis at alum.mit.edu> wrote:

> On 5/4/07, Rainer Joswig <joswig at lisp.de> wrote:
> >
> > (defmacro pt-red (terms) `(cddr ,terms))
> > (defun pctimes1 (c terms)
> >   (loop for (exp coef) on terms by #'pt-red
> > ...
> >
> ANSI Common Lisp defines the STEP-FUN in LOOP
> > to be a function. We cannot use a macro here.
> >
> > Probably there are more places where macros are
> > used like this?
> >
> 
> Isn't there a "strict" mode in any Common Lisp compiler that will catch
> things like this?

I guess this particular problem is a 'bug' in some LOOP implementations.

If we write (LOOP for ... on ... by #'foo ...

We want to mean #'foo as a function. A macro is not
a function, so it would not apply.

But the LOOP implementations in questions seem
to macro expand it to something like

...
  (foo ...)
...

Instead of

...
  (funcall #'foo ...)
...

I would find it confusing that I can write #'foo
in the former case, even while FOO is a macro.


> 
>            -s
> ---------------------------------------------------------------------
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima

-- 
http://lispm.dyndns.org