[Ecls-list] symbol-macro usage
Marko Kocić
marko.kocic at gmail.com
Wed Feb 10 20:40:35 UTC 2010
>>>> (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.
I agree it doesn't do much sense to use load-time-values, but since I
noted that all other lisp implementations swallow this I thaught it
might be the problem with ECL.
Thanks,
Marko Kocić
More information about the ecl-devel
mailing list