Setter Variables 
Author Message
 Setter Variables

   John Burger writes:

>  SETTER variables, as they are still called, are not defined
>  automatically, as a side affect of defining other variables.  In any
>  case, your example has nothing to do with SETTER variables, as

>    (SET! X 42)

>  does not use the variable X-SETTER in any way, it simply sets the
>  value of X through unspecified, internal means.  As described on p.
>  61, SETTER variables are only relevant to the _extended form_ of SET!.
>  X-SETTER would be used if you wrote

I do not see where on pp. 61-62, it states that X-SETTER is not used except
with the "extended form" version of set!.  I do see that it "must" be used
with the extended form.

>    (SET! (X FOO) 42)

>  which is roughly equivalent to

>    (X-SETTER FOO 42)

>  BTW, there really aren't any such things as SETTER variables anymore,
>  or at least there's no intensional difference between SETTER variables
>  and ordinary variables.  Some variables happen to have names of the
>  form FOO-SETTER, and some variables happen to have as their values
>  functions with the semantics of value assignment.  I suppose some
>  members of the intersection of those two sets might still be called
>  SETTER variables, but I think the "distinction" can often confuse
>  people.

I thought the idea was to allow a programmer to "override" a setter function
thereby gaining access to all which set a variable.  I believe this can be
done with slots, and my question was if it can be done with module variables.

Why doesn't (SET! X 42) check for an X-SETTER and call it if it exists?  Is
this specified somewhere, or is it the way Apple's Dylan works (or is that the
same question)?  Is it the way it is primarily for performance reasons?

        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)

Fri, 08 Dec 1995 20:40:02 GMT  
 [ 1 post ] 

 Relevant Pages 

1. Setter Variables and Re: Multiple Values

2. deleting setter method 5.1RC

3. Setters & Getters

4. Setter method question

5. What happened to setters?

6. Does 5 do setter/getter?

7. Setters and getters

8. Fast Parity Finder/Setter?

9. setter parameter order

10. Getters/Setters

11. better setter syntax?

12. Setter Syntax


Powered by phpBB® Forum Software