emacs-devel
[Top][All Lists]
Advanced

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

Re: map-char-table, optimize-char-table and `equal' comparisons


From: Kenichi Handa
Subject: Re: map-char-table, optimize-char-table and `equal' comparisons
Date: Wed, 14 May 2008 16:59:04 +0900
User-agent: SEMI/1.14.3 (Ushinoya) FLIM/1.14.2 (Yagi-Nishiguchi) APEL/10.2 Emacs/23.0.60 (i686-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO)

In article <address@hidden>, Stefan Monnier <address@hidden> writes:

> Both map-char-table and optimize-char-table compare consecutive values
> using `equal' to determine whether to merge them into ranges.

> I can see that it may sometimes be useful, but it is dangerous since it
> may lose object identity information (obviously) and more importantly
> because `equal' can fail when comparing cyclic objects.

> I happened to be manipulating char-tables that map chars to other
> char-tables, sometimes in cyclic ways and that makes it impossible to
> use map-char-table ;-(

> Any objection to changing the internal comparison predicate to `eq'?

I remember that I intentionally made the comparison
predicate `equal' so that optimize-char-table can reduce the
number of elements for some kind of char-table.

How about adding the new property/attribute :test to
char-table (like make-hash-table) and make the default to
`equal'?

---
Kenichi Handa
address@hidden




reply via email to

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