Re: OpenMCL and LispWorks work, CLISP and CMUCL fail on macros

From: Sam Steingold (sds_at_gnu.org)
Date: 03/28/05


Date: Mon, 28 Mar 2005 16:28:37 -0500


> * david.tolpin@gmail.com <qnivq.gbycva@tznvy.pbz> [2005-03-28 12:51:32 -0800]:
>
> I've written a combinator parsing-based set of macros, and successfuly
> used it and to write a program for my needs. During the development, I
> used OpenMCL, which worked fine. Unfortunately, the only other LISP
> implementation available to me that works with my macros is LispWorks;
> CMUCL says "attempt to reference undumpable constant" during
> execution, and CLISP says
>
>
> Compiling file /Users/dvd/Workplace/Davidashen/QST/cnc-lesy.lisp ...
> *** - COMMON-LISP::PRINT: Despite COMMON-LISP::*PRINT-READABLY*,
> #<CLOSURE :LAMBDA (#:L)
> (COMMON-LISP::LABELS
> ((#:STEP (#:L #:RL)
> (COMMON-LISP::LET
> ((#:R
> (COMMON-LISP::FUNCALL
> (LL-PARSING::PARSE-OR (CNC-LESY::SCAN-NAME)
> (CNC-LESY::SCAN-NUMBER)
> (LL-PARSING::PARCALL #'LL-PARSING::P-CHAR-CLASS
> '(#\( #\) #\[ #\] #\,))
> (CNC-LESY::SCAN-SPACE))
> #:L)))
> (COMMON-LISP::IF (LL-PARSING::SUCCESSP #:R)
> (#:STEP (COMMON-LISP::REST #:R)
> (COMMON-LISP::APPEND #:RL (LL-PARSING::RESULT #:R)))
> (LL-PARSING::RETURN-SUCCESS #:RL #:L)))))
> (#:STEP #:L COMMON-LISP::NIL))
>> cannot be printed readably.
>
> SBCL just fails with internal error.
>
> The macros are complex, but it is what the macros are for, in the end.
> I can live without CMUCL, but would love to make it run under CLISP.
> Where to look?

The CLISP error is pretty much equivalent to the CMUCL one.
What happens is that you are trying to write an interpreted function
(closure) into a FAS (compiled) file which neither CLISP nor CMUCL can
do (but, apparently, both MCL and LW can).

I don't think this is a violation of ANSI. More importantly, I think
this problem is indicative of a deeper problem in _your_ code. Why
would you want to save an _interpreted_ closure into a _compiled_ file?

This error means that you either "have an extra quote" and prevent this
closure from being automatically compiled (compiled closures can be
written to a compiled file), or you are "missing a quote" and the lambda
expression (a lambda expression, i.e., a cons cell, can also be written
to a compiled file) is being coerced to a closure prematurely.

At any rate, while explicitly compiling the closure will solve your
immediate portability problem, I urge you to figure out how to avoid that.

-- 
Sam Steingold (http://www.podval.org/~sds) running w2k
<http://www.honestreporting.com> <http://www.mideasttruth.com/>
<http://www.openvotingconsortium.org/> <http://www.camera.org>
Abandon all hope, all ye who press Enter.


Relevant Pages

  • RE: Compile Error: variable not defined
    ... The macros require the Analysis ToolPak, ... VBA thought that the function being used was a variable. ... ensure that Option Explicit is at the top of each module and ... I tried compiling both copies and they compiled ...
    (microsoft.public.excel.programming)
  • Re: Benefit of not defining the order of execution
    ... is not really necessary for compiling efficient code. ... precisely replicate the floating point arithmetic of the execution environment. ... If a and b were macros expanding to expressions with side effects, ...
    (comp.lang.c)
  • Re: Sacla loop: a new loop implementation
    ... >> But what about the practical issue that generating and compiling code ... > problem with macros that can explore type information? ... you _does_ fix this problem by using exactly "macros that can explore ... results in unacceptable performance and code bloat. ...
    (comp.lang.lisp)
  • Re: Macro Substitution Help Request
    ... arguments" when compiling with Imagecraft ICCAVR. ... I have written a set of macros that can be used to logically set or reset a specified port bit. ... Other code that you might want to include in your macro is saving output bytes/words in a "shadow" array, so that if you cannot read the output port directly, it will combine the new output bitwith the current value of other bits in the output port. ...
    (comp.lang.c)
  • Re: (apply #and (t t nil)) not work
    ... But SBCL said AND is a closure? ... Of course, macros are functions! ... They're code making code. ...
    (comp.lang.lisp)

Loading