Dylan Questions 
Author Message
 Dylan Questions

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?

        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)

Mon, 04 Dec 1995 19:49:48 GMT  
 [ 1 post ] 

 Relevant Pages 

1. Sundry Dylan Questions

2. A Few Dylan Questions...

3. harlequin dylan questions

4. Apple Dylan Question

5. PPC Apple Dylan Questions

6. Apple Dylan questions

7. Naive Dylan question

8. Naive Dylan question

9. Naive Dylan question

10. Two Dylan Questions

11. two dylan questions

12. Dylan question?


Powered by phpBB® Forum Software