[PATCH] fix unbound variable `WEBLOCKS::*REGISTERED-WEBAPPS*'

0 views
Skip to first unread message

John Fremlin

unread,
Feb 26, 2009, 1:01:00 AM2/26/09
to webl...@googlegroups.com, KURODA Hisao, Jianshi HUANG
In weblocks stable.

According to the ANSI standard, defparameter, defvar (Macro), need not
bind a variable at compile time.

If a ‘defvar’ or ‘defparameter’ form appears as a top level form,
the compiler must recognize that the NAME has been proclaimed
‘special’. However, it must neither evaluate the INITIAL-VALUE
form nor assign the dynamic variable named NAME at compile time.

Unfortunately Allegro 8 takes this seriously

Attempt to take the value of the unbound variable
`WEBLOCKS::*REGISTERED-WEBAPPS*'.
[Condition of type UNBOUND-VARIABLE]

5: (ERROR #<UNBOUND-VARIABLE @ #x738f01ba>)
6: ((METHOD SHARED-INITIALIZE :AFTER (WEBLOCKS:WEBAPP-CLASS T)) #<WEBLOCKS:WEBAPP-CLASS WEBLOCKS::WEBLOCKS-WEBAPP @ #x738ec7b2> T :NAME WEBLOCKS::WEBLOCKS-WEBAPP :DIRECT-SLOTS ...)
7: ((:INTERNAL (:EFFECTIVE-METHOD 2 T NIL NIL NIL) 0) #<WEBLOCKS:WEBAPP-CLASS WEBLOCKS::WEBLOCKS-WEBAPP @ #x738ec7b2> T . #<non-lisp object @ #xa>)
8: ((METHOD INITIALIZE-INSTANCE (STANDARD-OBJECT)) #<WEBLOCKS:WEBAPP-CLASS WEBLOCKS::WEBLOCKS-WEBAPP @ #x738ec7b2> :NAME WEBLOCKS::WEBLOCKS-WEBAPP :DIRECT-SLOTS ..)
9: ((METHOD MAKE-INSTANCE (CLASS)) #<CLOSER-MOP:STANDARD-CLASS WEBLOCKS:WEBAPP-CLASS> :NAME WEBLOCKS::WEBLOCKS-WEBAPP :DIRECT-SLOTS ..)
10: ((METHOD ACLMOP:ENSURE-CLASS-USING-CLASS (NULL T)) NIL WEBLOCKS::WEBLOCKS-WEBAPP :ENVIRONMENT #<Augmentable COMPILER environment> :GIVEN-ENV-ONLY ...)
11: (ACLMOP:ENSURE-CLASS WEBLOCKS::WEBLOCKS-WEBAPP :ENVIRONMENT #<Augmentable COMPILER environment> :GIVEN-ENV-ONLY T)
12: (COMPILER::EVAL-FROM-COMPILER-ENVIRONMENT (PROGN (ACLMOP:ENSURE-CLASS 'WEBLOCKS::WEBLOCKS-WEBAPP :ENVIRONMENT #<#> :GIVEN-ENV-ONLY T ...)))
13: (COMPILER::PA-EVAL-WHEN ((COMPILE) (ACLMOP:ENSURE-CLASS 'WEBLOCKS::WEBLOCKS-WEBAPP :ENVIRONMENT #<#> :GIVEN-ENV-ONLY T ...)))
14: (COMPILER::PA-COMPILE (EVAL-WHEN (COMPILE) (ACLMOP:ENSURE-CLASS 'WEBLOCKS::WEBLOCKS-WEBAPP :ENVIRONMENT #<#> :GIVEN-ENV-ONLY T ...)) NIL)
15: (COMPILER::COMPILE-PROCESS-FORM ..)

One solution is to move the *registered-webapps* variable to another
file, which will be compiled and loaded, and the value set, before it is used.

Why not put it in weblocks.lisp as there are plenty of variables there?

weblocks-20090226-registered-apps.patch

Leslie P. Polzer

unread,
Feb 26, 2009, 3:32:06 AM2/26/09
to weblocks
> One solution is to move the *registered-webapps* variable to another
> file, which will be compiled and loaded, and the value set, before it is used.
>
> Why not put it in weblocks.lisp as there are plenty of variables there?

I think we should do it the other way round:

Move all of those webapp globals to src/application.lisp and wrap them
in
an EVAL-WHEN to make them available at compile-time.
Reply all
Reply to author
Forward
0 new messages