Limiting accepted values in slots 
Author Message
 Limiting accepted values in slots

        I just started playing with Dylan this last weekend, and I have
some simple questions for you Dylan "old timers."

        When defining slots in a class, I can easily limit the slot to
accept a value of one class, but is there a way to limit the values to
specific items?  I suppose I could write my own setter (is that the right
terminology?) to, say, limit the accepted values to 'red, 'green, etc., or
the integers 1 to 6, but it would be nice to simply specify it within the
slot specification keywords.

        I may have missed some elegant way of doing this, but, if not,
might there be some small modification to the language that would allow
this (I'm not really qualified to make a suggestion, but something like,
e.g., allowing the relevant  keywords to accept more than one
class/singleton argument?)?

        Any comments, and especially code fragment examples would be most

--      Dave

                                                                  UR  \|/
                                                                  LLE /|\

Sat, 05 Aug 1995 22:53:25 GMT  
 [ 1 post ] 

 Relevant Pages 

1. Dylan Tip #101: don't use keyword init-values with class allocated slots

2. Objects with Lazy Evaluation Slot Values

3. :ALLOCATION :CLASS: getting slot value

4. incrementing slot value

5. :initform and slot-value

6. Back door to 'slot-value-using-class?

7. Accessing foreign type array slot value (ACL 5.0)

8. with-slots and multiple-value-bind

9. Before method for SLOT-VALUE

10. What happens to return value of SLOT-UNBOUND?

11. Find a radio buttons accepted value

12. "Accept" resets values


Powered by phpBB® Forum Software