This is the mail archive of the guile@cygnus.com mailing list for the guile project.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
Christian Lynbech <chl@tbit.dk> writes: > >>>>> "Mikael" == Mikael Djurfeldt <mdj@nada.kth.se> writes: > > Mikael> Now I'm thinking of letting #:accessor <name> create the accessors > Mikael> <name> and set-<name>! instead. > > I am not happy with set-<name>!. One has to be carefull about > polluting peoples namespace. So either accessors should be kept as > generic functions, extending the getter name to also handle setting, What do you mean? (x o 1) (x o) -> 1 ? I think (set-x! o 1) (x o) -> 1 is clearer. > What I like about the setf! approach is that it is extremely usefull > against arbitrary namespace pollution. For instance, records could > really benefit from this as well. I don't think it is arbitrary. And, besides, if the user isn't happy about set-x! he can choose a better name himself with #:setter, and he doesn't even need to create getter or setter names at all. We can export an STk-version of setf! (named `set!') from a compatibility module together with a version of `define-class' which uses an STk metaclass. It may also be more consistent to rename #:accessor to #:accessors if it's going to generate both `x' and `set-x!'. (Logic: Both mutators and selectors are "accessors".) /mdj