Re: Using methods on (setf foo)?

From: Bruno Haible (bruno_at_clisp.org)
Date: 10/21/04


Date: 21 Oct 2004 15:29:31 GMT

Peter Seibel <peter@javamonkey.com> asked:
>
> On the other hand, mightn't it violate the principle of
> least astonishment to have a simple "assignment" have such dramatic
> side effects?

No, that's essentially why the accessor methods are part of generic
functions: So that programmers can add bookkeeping updates.

People who want just the "simple assignment" can use
  (setf (slot-value playlist 'songs) ...)
as a last resort.

                   Bruno



Relevant Pages

  • Re: big bang would violate the equivalence principle
    ... big bang and black holes violate that principle. ... Black holes a spot in space ... There are observations where "black hole candidates" orbit ... But that can't be the case and it would violate the ...
    (sci.physics.relativity)
  • Re: Perl
    ... On Fri, 5 Sep 2003, jeff wrote: ... That would violate what we refer to as The Principle of Least ...
    (freebsd-stable)
  • Re: [opensuse] DHCP lease requests (solved)
    ... but it does violate Wolfgang's Principle of Least ... Astonishment. ... I think it would be a clever thing to do - I don't know how often it's ...
    (SuSE)
  • Re: Heisenberg vs. Einstein
    ... violate the position-momentum uncertainty ... principle, shouldn't we expect some 'fuzzyness' ...
    (sci.physics.relativity)