[m-users.] Undefined predicate in C FFI code, present in generated C file.

Zoltan Somogyi zoltan.somogyi at runbox.com
Thu Sep 21 18:12:02 AEST 2023


On 2023-09-21 17:23 +10:00 AEST, "Sean Charles (emacstheviking)" <objitsu at gmail.com> wrote:
> Thank you Peter, I just couldn't see it, I couldn't. In my defense, I'm stupid.

Believe me, this kind of error is not unique to you. It even has its own wikipedia page:

https://en.wikipedia.org/wiki/Rubber_duck_debugging

although in my lectures on software development I called it teddy bear debugging,
because that was the inanimate object used for the same purpose in a story
explaining this phenomenon in a book titled "The psychology of computer programming"
by https://en.wikipedia.org/wiki/Gerald_Weinberg. Since this book was
published in 1971 (NOT A TYPO), I figured it has precedence in naming :-)

By the way, I recommend this book very highly. The technologies in it
are all ancient, but the book is about people, not machines, and we humans
are still roughly the same as we were then. I think that one of the other stories in it
actually explains the root of the conflict between proponents of strongly-typed
and untyped languages, and why each camp believes the other to be
almost crazy for having the opposite preference.

The "cirle" phenomenon is caused by psychological set, which means that
since you intended to type "circle", your brain believes that is what you
actually typed, so that when it reads "cirle" from that same place, it believes
that it was the reading-back process that was faulty, not the typing-it-in process,
and it "corrects" what was read to "circle" before presenting it to your higher level
conscious thinking.

And a second by-the-way: the fact that compiler writers are also subject to this
kind of error is why some compilers, when reporting some undefined entity,
now include in the error message a list of entities of the same kind that have
sort-of-similar names. I will think about adding something similar to mmc,
if I can find some publicly available algorithm for this kind of similarity checking.
(I don't think simple edit distance would be helpful in this case, because
I think it would generate too many misleading recommendations.)
Of course, mmc already points out near misses in terms of arity,
or in terms of predicate vs function.

Zoltan.


More information about the users mailing list