[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#18223: Duplicate of issue 14792
From: |
David Kastrup |
Subject: |
bug#18223: Duplicate of issue 14792 |
Date: |
Sat, 09 Aug 2014 11:46:42 +0200 |
This is actually a duplicate of issue 14792 which has been ignored for
over a year by now.
Please see <URL:http://debbugs.gnu.org/cgi/bugreport.cgi?bug=14792#35>
for the reason the provided patch (namely discouraging the use of
numbers for object properties) is the only one making sense.
Here is the rationale in code: object properties are implemented via
key-weak hash tables, and weak hash tables will not work with eqv? as
equivalence since key-weakness is related to garbage collection which
cannot consider anything but eq?-equivalence.
scheme@(guile-user)> (define x (make-weak-key-hash-table))
scheme@(guile-user)> (hashv-set! x 100000000000000000000 #t)
$6 = #t
scheme@(guile-user)> (gc)
scheme@(guile-user)> (hashv-ref x 100000000000000000000)
$7 = #f
Guile and/or Scheme do not store the equivalence relation in the
hashtable itself, and user-definable hash functions may establish
arbitrary relations regarding key uniqueness that have no clear relation
to the object identity used by garbage collection.
--
David Kastrup