Re: Remove-common function in Lisp



Alan Crowe <alan@xxxxxxxxxxxxxxxxxxxxxxx> writes:

CL-USER> (defun purge (suspect black-list)
"list reliable comrades"
(let (reliable)
;; Check all suspect comrades against the blacklist
;; returning the reliable ones
(dolist (comrade suspect reliable)
(unless (find comrade black-list)
(push comrade reliable)))))
PURGE

CL-USER> (purge '(a b c d e) '(b d))
(E C A)

Actually it is not clear to me that "going too far" does any
real harm. I'm guilty of using generic names. Sometimes I
make a bit of an effort to choose more suggestive names and
it always pays off. Has any-one actually overdone it on real
code, permitting them to say "it hurts you like this ..."

Well, there are certainly ways you can run afoul of things. You can
confuse and side-track people with overly obscure metaphors:
(defun purge (dromedary newsgroup) ...)
and can offend people with others [I'll let you use your imagination
there].

You could even lay a trap where a confusion that comes later, as in:

(defpackage "CROWE-UTILS"
(:export "PURGE"))
...
(defpackage "CRIME-SCENE-INVESTIGATION"
(:nicknames "CSI")
(:use "CROWE-UTILS"))
(in-package "CSI")
(defclass suspect ...)

and then someone starts to type "(purge" and presses control-shift-A
in Emacs to see what the arglist of purge is and finds he must give
a SUSPECT as a first argument. That could confuse your user as to whether
that's a role or an actual instantiable object. Hard to see how to predict
that this was coming unless you want to bet against the success and broad
use of your program. Even just
(defun cons (car cdr) ...)
in an automobile factory could cause a bit of consternation if you assume
the only knowledge the programmer has is of cars and none of Lisp. I guess
the whole point of understanding packages is to help people come to grips
with the fact that these things happen.

One slightly more substantive risk is not "going too far" but picking
a word that appears to have extra out-of-band meaning. In your
example, you suggest a metaphor of a system in which there was a
suspect and a black-list, but such societies (we have one now) do lots
of record-keeping, and this could cause someone to believe there was
not just functional effect but memory [persistent state beyond the
call] involved in "reporting" a suspect. (Maybe a minor stretch in
this example, but easily within the realm of reason in other
applications I've seen.) So pick your metaphor carefully to convey
the extra baggage you want and not the baggage you don't.

On the whole, I think these pitfalls are usually worth the risk, and I
agree that a robust metaphor is often best. Leadership is about
establishing a vision. You can change the vision if it turns out not
to work out, but it's useful to have something clear you're rallying to.
.



Relevant Pages

  • Re: AKICIF - Satnav aerials
    ... external antenna, and they seem to be available moderately cheaply. ... rises around us confuse it, and I wouldn't be surprised if you get a similar ... This seems pretty likely as one of the causes, but I suspect, as someone else has pointed out, that processing power may also be a problem. ... Forgotten Futures - The Scientific Romance Role Playing Game ...
    (rec.arts.sf.fandom)
  • Re: Turning right.
    ... Martin Dann wrote: ... who confuse the hell out of everybody by giving way when they should be getting on and out of the way. ... I suspect if you're finding this happens more to you on your bike that it's because you're intensely gazing at the driver who 'gets a message that you want your bit of the road!' ...
    (uk.rec.cycling)
  • Re: BBC News on Radio 4
    ... LOL, to most people that would just confuse I suspect, "Can't I listen to ... BBC Radio to in my VW anymore, do I have to drive a Vauxhall?"... ...
    (uk.tech.broadcast)
  • Re: The Standard PIE model criticized
    ... I forgot to say in this video "pushing-scrub" is a metaphor. ... I suspect that' not what John was out ...
    (sci.lang)