Associative array/Creation: Difference between revisions
→A persistent associative array from scratch
Line 4,284:
{{libheader|srfi-151}}
Most implementations of associative arrays—including those for Scheme—are for ‘''mutable''’ arrays, whose previous values are effectively lost whenever an insertion is done. Here instead is a ''persistent'' (‘''immutable''’) implementation, using code from [[AVL_tree#Scheme|the AVL Tree task]]. (So performance will be on average logarithmic. Just be aware of that.)
Associate arrays are not part of the Scheme language itself, but are compiler/interpreter or library add-ons. So I feel justified in presenting this sketch of yet another library add-on.
<lang scheme>(cond-expand
|