For symmetry there is "make-immutable-hash", which is like "hash" but has
the interface of "make-hash". (I don't know why "hash" is the way it is
though).

--spencer

On Wed, Dec 7, 2016 at 10:49 AM David Storrs <david.sto...@gmail.com> wrote:

> -> (hash 'a 1 'b 2)
> '#hash((a . 1) (b . 2))
>
> -> (make-hash '((a . 1) (b . 2)))
> '#hash((b . 2) (a . 1))
>
> -> (make-hash 'a 1 'b 2)
> (make-hash 'a 1 'b 2)
> ; make-hash: arity mismatch;
> ;  the expected number of arguments does not match the given number
> ;   expected: 0 to 1
> ;   given: 4
> ; [,bt for context]
>
> Why does 'make-hash' not work like 'hash'?  Is it possible that a flag
> could be added that would *make* it work like hash?  Or, alternatively,
> does another function exist that will create a mutable hash but will accept
> N arguments the way 'hash' does?  I understand that it's not very FP to use
> mutation but there are certain problems that are easier that way.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to racket-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to