[Openmcl-devel] Series compilation question.

Gary Byers gb at clozure.com
Fri Nov 15 12:53:18 PST 2002



On Thu, 14 Nov 2002, Gary Byers wrote:

>
>
> On Thu, 14 Nov 2002, Barry Perryman wrote:
>
> > I thought I'd take a look at series. I downloaded the package off
> > sourceforge and compiled it up, as per the instructions. It compiles with
> > the error messages at the end of this email. The odd thing is that if you
> > run the test suite it's seems to pass with flying colours.
> >
>
> It's important to remember that the messages below are warnings, not
> errors.
>
> SERIES seems to generate lots of code of the form:
>
>  (flet ((<SOME-UNINTERNED-SYMBOL> (args) (do-something-with args)))
>    (funcall #'<SOME-UNINTERNED-SYMBOL> an-arg-or-two))
>
> The compiler seems unable to see that the call to the local function
> occurs within the scope of a local definition of that function (and
> warns that the function name is unknown), but compiles the funcall as
> a local function call.

What's actually happening is a bit more obscure; it wasn't the (deprecated)
COMPILER-LET, but something happening inside  MACROLET that was causing
the problem.

The OpenMCL generally warns about cases involving (FUNCTION <symbol>),
when there's no lexically visible or globally known function definition
of <symbol>.

The series code that generated the warnings was of the form:

(DEFMACRO some-function-name (...)
   ...
   (MACROLET ((some-function-name (&WHOLE call ...)
                ...
               (FUNCALL (FUNCTION gensymed-name))))
     (FLET ((gensymed-name (...) ..))
        ...)))

When compiling the local macroexpansion function (the function defined
via MACROLET), the compiler saw (FUNCTION gensymed-name), and generated
a warning to the effect that there was no visible or known function of
that (gensymed) name.

The warnings might have been a bit clearer if they's said something like:

> > ;   Undefined function #:COLLECT-MIN-4278, in local macro function SERIES:COLLECT-MIN.
> > ;   Undefined function #:COLLECT-MAX-4227, in local macro function SERIES:COLLECT-MAX.

>
> > Any clues?
> >
>
> I don't have easy access to OpenMCL sources at the moment, but I'd
> almost be willing to bet that COMPILER-LET processes its body in
> the null lexical environment and that the use of
>
> (funcall #'foo ...)
>
> instead of
>
> (foo ...)
>
> may have been an attempt to suppress warnings in this case.

COMPILER-LET is (was ...) certainly bizarre, but not so bizarre as I'd
remembered.


So:

 1) There are no errors here
 2) There are warnings to the effect that certain functions aren't
    defined at the time that they're referenced.  The messages could
    be a little clearer about where those references are coming from;
    in this case, it's especially hard to understand because local
    macro-functions have the same name as surrounding global macro
    functions.
 3) It's not entirely clear why the MACROLETted function is making
    a forward reference to an as-yet-undefined FLETted function; it
    is -referencing- (FUNCTION #:g001), not merely expanding into
    such a reference, and a (tentative) warning seems legitimate.



>
> > Barry
> >
> > ? (compile-file "s-code")
> > ;Compiler warnings for "/Users/barry/src/series/s-code.lisp" :
> > ;   Undefined function #:COLLECT-MIN-4278, in SERIES:COLLECT-MIN.
> > ;   Undefined function #:COLLECT-MAX-4227, in SERIES:COLLECT-MAX.
> > ;   Undefined function #:COLLECT-PRODUCT-4206, in SERIES:COLLECT-PRODUCT.
> > ;   Undefined function #:COLLECT-SUM-4185, in SERIES:COLLECT-SUM.
> > ;   Undefined function #:COLLECT-LENGTH-4167, in SERIES:COLLECT-LENGTH.
> > ;   Undefined function #:COLLECT-OR-4149, in SERIES:COLLECT-OR.
> > ;   Undefined function #:COLLECT-AND-4131, in SERIES:COLLECT-AND.
> > ;   Undefined function #:COLLECT-NTH-4104, in SERIES:COLLECT-NTH.
> > ;   Undefined function #:COLLECT-FIRST-4083, in SERIES:COLLECT-FIRST.
> > ;   Undefined function #:COLLECT-LAST-4062, in SERIES:COLLECT-LAST.
> > ;   Undefined function #:COLLECT-PLIST-4035, in SERIES:COLLECT-PLIST.
> > ;   Undefined function #:COLLECT-ALIST-4008, in SERIES:COLLECT-ALIST.
> > ;   Undefined function #:COLLECT-STREAM-3972, in SERIES:COLLECT-STREAM.
> > ;   Undefined function #:COLLECT-FILE-3927, in SERIES:COLLECT-FILE.
> > ;   Undefined function #:COLLECT-HASH-3897, in SERIES:COLLECT-HASH.
> > ;   Undefined function #:COLLECT-APPEND-3837, in SERIES:COLLECT-APPEND.
> > ;   Undefined function #:ALTER-2497, in SERIES:ALTER.
> > ;   Undefined function #:COLLECT-IGNORE-2257, in SERIES::COLLECT-IGNORE.
> > ;   Undefined function #:COLLECT-FN-2138, in SERIES:COLLECT-FN.
> > ;   Undefined function #:COLLECT-1660, in SERIES:COLLECT.
> >
> >
> >
> >
> > _________________________________________________________________
> > Add photos to your messages with MSN 8. Get 2 months FREE*.
> > http://join.msn.com/?page=features/featuredemail
> >
> >
> > _______________________________________________
> > Openmcl-devel mailing list
> > Openmcl-devel at clozure.com
> > http://clozure.com/cgi-bin/mailman/listinfo/openmcl-devel
> >
> >
>
>
> _______________________________________________
> Openmcl-devel mailing list
> Openmcl-devel at clozure.com
> http://clozure.com/cgi-bin/mailman/listinfo/openmcl-devel
>
>


_______________________________________________
Openmcl-devel mailing list
Openmcl-devel at clozure.com
http://clozure.com/cgi-bin/mailman/listinfo/openmcl-devel



More information about the Openmcl-devel mailing list