On 3/5/07, Kon Lovett <address@hidden> wrote:
On Mar 5, 2007, at 11:23 AM, Graham Fawcett wrote:
>> However I think a '(hash-table-remove! hash-table (-> key value
>> boolean))' procedure should be added to "extras.scm" just to be
>> "safe".
>
> Could you please explain that signature? I don't know how to
interpret
> your (-> ...) form.
A strict prefix form:
(-> key value boolean) is (key value -> boolean) but should be
(object object -> boolean) since there are no key & value types.
Thanks. I thought it looked like Haskell, and I wasn't that far off.
:-) Wouldn't it be '(hash-table-remove! (-> hash-table key value
boolean)) ? Or do you write it as you did because the procedure
mutates the hash-table?
And lastly, are you passing both key and value in for correctness'
sake (in lieu of passing in the actual bucket, to which we don't have
a reference in a hash-table-walk), or would your implementation
actually test for equality on both before removing?