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

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

Re: Are two symbols `equal' iff they are `eq'?


From: Marcin Borkowski
Subject: Re: Are two symbols `equal' iff they are `eq'?
Date: Sun, 09 Aug 2015 21:41:24 +0200

On 2015-08-09, at 20:19, Eli Zaretskii <address@hidden> wrote:

>> From: Marcin Borkowski <address@hidden>
>> Date: Sun, 09 Aug 2015 17:45:31 +0200
>> 
>> >> >From the capitalization I would guess that QUIT is a C macro.  From its
>> >> name I would guess that anything after it is irrelevant;-).  Well,
>> >> joking aside, I found its definition in the source; do I get it right
>> >> that it quits if something like C-g happens?
>> >
>> > Yes.
>> >
>> >> If yes, I'd be curious why it is here.
>> >
>> > To allow the user to interrupt a (potentially) long operation.
>> 
>> That's obvious, I just wondered why at this point.
>
> Because that point is traversed every recursion, so we check for C-g
> on each "iteration", so to say.

Ah, I see.  That does make sense.  Thanks!

>> >> Apart from that, it seems that I was right: `equal' for
>> >> symbols just calls `eq' (C EQ, not Lisp eq, to be more precise).
>> >
>> > What else could it possibly do?
>> 
>> It could e.g. compare the string representation, so two symbols with the
>> same name but in different obarrays, or one interned and the other not,
>> could be equal but not eq.
>
> I'm sure you understand how all of those would make no sense as
> "equality" of any kind.

Frankly, I don't.  I don't really have enough experience with the very
ideas of a "symbol", of "interning" and of an "obarray" (in particular,
having many of them) to see this.  I guess when I learn more Lisp (maybe
Common Lisp?), I'll see this.  But I believe you, and this is enough for
me now - I'll just try to keep that issue in my mind during my further
studies, and maybe I'll get it some day.  I'm not in a hurry, you
know;-).

>> (I'm not sure whether this would be useful, though - just a
>> thought.)
>
> If it won't be useful, why would someone do it?

If not, then not.  I agree.

Best,

-- 
Marcin Borkowski
http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski
Faculty of Mathematics and Computer Science
Adam Mickiewicz University



reply via email to

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