[erlang-questions] Proposed addition to gb_trees

Richard A. O'Keefe ok@REDACTED
Mon Nov 30 03:34:27 CET 2015


On 28/11/2015, at 6:55 am, Pierpaolo Bernardi <olopierpa@REDACTED> wrote:

> On Fri, Nov 27, 2015 at 6:14 AM, Richard A. O'Keefe <ok@REDACTED> wrote:
> 
> It should take an optional initializer parameter, like for example the
> corresponding function in Racket.
> 
> http://docs.racket-lang.org/reference/hashtables.html#%28def._%28%28lib._racket%2Fprivate%2Fmore-scheme..rkt%29._hash-update%29%29

That's a somewhat broken interface.  If you want the
default result to be a function, you have to wrap an
extra function around it, which is nasty.

The documentation of hash-update is ambiguous; it is
not clear whether the failure-result argument is used
as the failure-result of the implicit hash-ref or as
the result of hash-update itself.





More information about the erlang-questions mailing list