Thanks, Thomas. Patch is applied.
cheers, felix On 2/21/06, Thomas Chust <[EMAIL PROTECTED]> wrote: > Hello, > > the function hash-table-update!/default and also hash-table-update! on > which it is based in CHICKEN do not behave as prescribed by SRFI-69: > > > $ csi > > @@@@@@@ @@@ @@@ @@@ @@@@@@@ @@@ @@@ @@@@@@@@ @@@ @@@ > > !@@ @@! @@@ @@! !@@ @@! !@@ @@! @@[EMAIL PROTECTED]@@@ > > [EMAIL PROTECTED] @[EMAIL PROTECTED]@[EMAIL PROTECTED] !!@ [EMAIL > > PROTECTED] @!@@[EMAIL PROTECTED] @!!!:! @!@@[EMAIL PROTECTED] > > :!! !!: !!! !!: :!! !!: :!! !!: !!: !!! > > :: :: : : : : : :: :: : : ::: : :: ::: :: : > > > > Version 2, Build 301 - macosx-unix-gnu-ppc - [ libffi dload ptables ] > > (c)2000-2005 Felix L. Winkelmann > > #;1> (define ht (make-hash-table)) > > #;2> (hash-table-update!/default ht 'x add1 0) > > #;3> (hash-table-ref ht 'x) > > 0 > > The correct return value would be 1 because SRFI-69 states: > > > Procedure: hash-table-update! hash-table key function [ thunk ] => undefined > > > > Semantically equivalent to, but may be implemented more efficiently > > than, the following code: > > > > (hash-table-set! hash-table key > > (function (hash-table-ref hash-table key thunk))) > > This means, that "function" has to be called, even if the key is not > present in the hashtable, which CHICKEN fails to do. > > A patch fixing extras.scm (created with darcs send) is attached. > > cu, > Thomas > > _______________________________________________ > Chicken-users mailing list > [email protected] > http://lists.nongnu.org/mailman/listinfo/chicken-users > > > > _______________________________________________ Chicken-users mailing list [email protected] http://lists.nongnu.org/mailman/listinfo/chicken-users
