[Ecls-list] symbol-macro usage
Tobias C. Rittweiler
tcr at freebits.de
Wed Feb 10 19:07:26 UTC 2010
Marko Kocić writes:
> Yes
>
> On 2/10/10, Tobias C. Rittweiler <tcr at freebits.de> wrote:
>> Marko Kocić writes:
>>
>>> I'm trying to port hunchentoot to ecl, and I encountered this code in
>>> file specials.lisp in latest hunchentoot that fails to compile with
>>> ecl:
>>>
>>> (define-symbol-macro *supports-threads-p*
>>> #+:lispworks t
>>> #-:lispworks bt:*supports-threads-p*)
>>>
>>> (defvar *global-session-db-lock*
>>> (load-time-value (and *supports-threads-p* (make-lock
>>> "global-session-db-lock")))
>>> "A global lock to prevent two threads from modifying *session-db* at
>>> the same time \(or NIL for Lisps which don't have threads).")
>>
>> Are these two forms in the same file?
>>
>> -T.
In this case, it's not portable code. The standard does not specify in
what order forms in LOAD-TIME-VALUE and toplevel forms are evaluated.
That said, I don't see a point in using LOAD-TIME-VALUE in combination
with DEFVAR. Just get rid of it.
-T.
More information about the ecl-devel
mailing list