🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

1 total messages Started by Jeff Dalton Thu, 12 Nov 1992 19:38
Re: setf methods
#298
Author: Jeff Dalton
Date: Thu, 12 Nov 1992 19:38
19 lines
1372 bytes
> When I learned about object oriented programming one of the views that
> was taught was that the set of methods of a class should preserve a
> set of invariants related to the class. I.e. the object state before
> and after a (official or exported) method is run should satisfy a set
> of constraints, which of course could be violated while running the
> method.

This is a good idea, but it's not clear that it should apply to
accessors (or readers or writers).  (1) It's reasonable to do all
slot access via accessors and never use SLOT-VALUE and (2) it's
often necessary to make several state changes before you're back in
a consistent state.

Obviously, there are some, even many, accessors that could be asked
to maintain the invariant, but I don't think it can work as a general
rule for all public accessors.  This sort of thing works better in
languages wiht "instance variables", I suspect.

-- jd
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads