Page 1 of 1

newbie question: compilation warning

Posted: Thu Apr 11, 2013 7:40 am
by hajovonta
I have the following warning when compiling a project in Allegro CL 9.0:

Code: Select all

; While FILE-COMPILING #'(:TOP-LEVEL-FORM "main.cl" 0) in #P"C:\\allegro-projects\\web\\main.cl"
; starting at file character position 0:
Warning: compile-file found "REQUIRE" at the top-level --  see the documentation for comp:*cltl1-compile-file-toplevel-compatibility-p*
I did a search on the web, and found some explanations, but I don't exactly know what are my possibilities to get rid of it.

Re: newbie question: compilation warning

Posted: Fri Apr 12, 2013 12:13 am
by Kompottkin
Do you really need to use require? It's deprecated. If you want to make use of libraries, use Quicklisp.

Anyway, the documentation page referenced by the error message tells you what you need to do to fix the issue: Wrap the require form in an eval-when. Like this:

Code: Select all

(eval-when (:compile-toplevel :load-toplevel :execute)
  (require ...))

Re: newbie question: compilation warning

Posted: Fri Apr 12, 2013 1:04 am
by hajovonta
Thanks, Kompottkin. I like Quicklisp, however, when you load it into AllegroCL Express, it almost fills the entire heap granted in this edition. And I have a very small and simple project, so a simple require is enough. The code you provided works.