Mutability and make-immutable-hasheq

4 views
Skip to first unread message

Anonymer

unread,
Nov 29, 2010, 8:07:54 PM11/29/10
to byu-cs-330-Fall-2010
Why does the make-immutable-hasheq appear to make a MUTABLE hash when
'immutable' is in its name?

(hash-ref (hash-set (make-immutable-hasheq (list (list 1 50))) 1 600)
1)

Jay McCarthy

unread,
Nov 29, 2010, 9:42:14 PM11/29/10
to byu-cs-330...@googlegroups.com
hash-set returns a new hash table. This only works for immutable tables.

hash-set! imperatively modifies an old hash table. This only works for
mutable tables.

PS, WIfi on a plane is so cool

Jay

--
Jay McCarthy <j...@cs.byu.edu>
Assistant Professor / Brigham Young University
http://faculty.cs.byu.edu/~jay

"The glory of God is Intelligence" - D&C 93

Reply all
Reply to author
Forward
0 new messages