emacs-devel
[Top][All Lists]
Advanced

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

Re: delq string element in ido


From: Teemu Likonen
Subject: Re: delq string element in ido
Date: Sat, 26 Dec 2009 14:34:14 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux)

On 2009-12-26 12:13 (UTC), Leo wrote:

> 2009/12/26 Andreas Schwab <address@hidden>:
>> Because `eq' returns t for identical Lisp objects.

> I don't quite get it.
>
> If buf holds "str1" and ido-cur-list '("str1" "str2" "str3"), (delq
> buf ido-cur-list) does not return '("str2" "str3"). But it does inside
> ido-kill-buffer-at-head. That's where I am confused.

It's not actually "identical Lisp objects"; eq is about the _same_ Lisp
object. Let me demonstrate:

    (setq my-list (list "one" "two")
          my-one (car my-list))

Internally my-one and (car my-list) refer to the same Lisp object:

    (eq my-one (car my-list))
    => t

But in the following examples the string "one" creates new Lisp object
which is different from the one referenced by my-one or (car my-list).

    (eq "one" (car my-list))
    => nil

    (eq "one" my-one)
    => nil




reply via email to

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