chickadee » lookup-table » dict-update!

(dict-update! DICT KEY DEFAULT-VALUE-PROCEDURE [FUNC identity])procedure

Invokes FUNC on either the existing value for KEY in the DICT, or the result of the DEFAULT-VALUE-PROCEDURE when no existing value. The result then becomes the value for KEY in the DICT.

Returns the updated value for KEY in the DICT.

DEFAULT-VALUE-PROCEDURE must not return (void)!