GNU bug report logs - #18223
[PATCH] Fix thinko concerning object property docs

Previous Next

Package: guile;

Reported by: David Kastrup <dak <at> gnu.org>

Date: Fri, 8 Aug 2014 13:44:01 UTC

Severity: normal

Tags: patch

Merged with 14792

Done: Mark H Weaver <mhw <at> netris.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: David Kastrup <dak <at> gnu.org>
To: 18223 <at> debbugs.gnu.org
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




This bug report was last modified 10 years and 285 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.