Re: mop: modify generic function



John <MB42gDv0@xxxxxxxxxxxxxx> writes:

> As far as I can see the only real reason people give for not including it
> is to save typing.
>
> At a typing rate of 60wpm (low estimate for people in this group) I fail
> to see how much time this really saves. Certainly not enough to sacrifice
> clarity.

when the generic-function is part of a public protocol then i use
defgeneric. if we're talking about the only method for a
generic-function, and it's not a function only to get some extra error
checking, then i'd not use defgeneric.

(defgeneric startup (object &key &allow-other-keys)
...)

(defmethod startup ((server server-type1) &key ...))

(defmethod startup ((server server-type2) &key ...)

vs.

(defmethod access-slot-with-dwim ((object object-type))
..)

in the second case access-slot-with-dwim isn't really a 'generic'
function, we don't plan of having other methods and the only
documentation we can think of only makes sense in the context of the
method.

--
-Marco
Ring the bells that still can ring.
Forget the perfect offering.
There is a crack in everything.
That's how the light gets in.
-Leonard Cohen
.



Relevant Pages

  • Re: Congratulations Lloyd--- SS Billiards is 35!
    ... (no real reason for typing that) ... Anyway, yeah the storms seem ...
    (rec.games.pinball)
  • Re: Alphabetical posts
    ... the real reason that it was almost certainly done by a ... man is that it was almost certainly done by writing a script, ... not by typing every entry in by hand :-) ...
    (uk.rec.gardening)