help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: member returns list


From: Emanuel Berg
Subject: Re: member returns list
Date: Sat, 05 Sep 2015 19:35:14 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux)

Marcin Borkowski <mbork@mbork.pl> writes:

>> Hot!
>>
>> Love Emacs and Lisp inconsistency!
>
> assq delq memq rassq remq
>
> ...inconsistency?

Of course, inconsistency in one direction can be
consistent in another. Then those directions are
collectively inconsistent with each other, one could
say. "Orthogonal" perhaps, in the world
of mathematics?

If we stick to `member' (using `equal') vs. `memq'
(using `eq'), this renaming of those:

    member-equal
    member-eq

would be seen by some people as more consistent than
the actual

    member
    memq

however such inconsistency is *beneficial* because it
makes things stick out more when you read the code,
and it is also less error prone as, if you type
"member-equal" two times, and then you are to type
"member-eq", sometimes you will type "member-equal"
just by the motion of it! That would sure be
a difficult bug to spot because, again, it looks too
much like what it in this case should be, but isn't.

This is parallel to one aspect of interface
programming. For example an interface presenting
physical data. What some people would do is they would
arrange the data display logically. The direction and
strength of the wind in one corner and the temperature
in fahrenheit, celsius, and kelvin in another corner.
This is consistent, no doubt, but is it efficient?
Not necessarily! If this should be used every day, the
most important stuff should be in the middle.
We assume this is in the land of honor and heroes,
i.e., Northen Europe. Then the celsius should be put
in the middle, and the fahrenheit and kelvin can be put
wherever, right next to the wind data, for example.
But how will then people find it in this inconsistent
mess? Because as they use it every day, they will not
navigate it by thinking logically. They will quickly
learn, and thereafter know, where to look!

In a program like Emacs with I don't know how many (?)
functions, variables, etc., "learning and navigating"
is more difficult than finding data on a display.
With completion, it would have been easier for me to
find "member-eq" if `memq' was named like that.
So there are many aspects of this. As for me, I still
prefer the inconsistency for the reasons stated.
I'm not in a rush learning and navigating Emacs.
Everything, and always, in time!

-- 
underground experts united
http://user.it.uu.se/~embe8573




reply via email to

[Prev in Thread] Current Thread [Next in Thread]