I have a few questions about two Dylan features. The first few concern setter
(module) variables:
- When are they defined? That is, does (define x 1) define x-setter?
- How can one capture a built-in setter? For example, does the following
display "setting x"?
(define x 1)
(set! x-setter (method (val) (print "setting x") (set! x val)))
(set! x 2)
Or does this result in an infinite loop? If not, what stops the recursion?
The other question involves getting/setting slots with allocation type "class"
It is often necessary to get/set "class variables" directly (i.e., when an
instance is not available). The following example shows what I mean but I don't
see where this is legal in the "book":
(define-class <foo> (<object>)
(class-var allocation: class))
(class-var-setter <foo> "something") ;setter specialized on the class
(class-var <foo>) ;getter specialized on the class
Is there a way to accomplish this in Dylan?
Thanks,
{*filter*}
----
Richard W. (Dick) Kreutzer
Voice: +1(801)571-2446 FAX: +1(801)571-2448
Mail: Integra Software Corp.; 1378 Jasmine Avenue; Sandy, UT 84092 (USA)