Thank you very much for this nice intermediate solution, though I need constant-time append, split, insert, remove, + pointers to items, etc. Mutation does seem unavoidable, right.<br>I started my own lib, but if something already exists, I'm still interested.<br>
<br>The purpose is to make a hash with bounded memory, with replacement of oldest items, or barely used items, or some other replacement criterion.<br><br>The final purpose is to make a memoization form with bounded memory, or growing memory but with frequent removal of selected items. If I have time to get there.<br>
<br>I'll keep the zipper in mind for other purposes though!<br><br>Laurent<br><br><div class="gmail_quote">On Tue, Aug 30, 2011 at 08:35, Danny Yoo <span dir="ltr"><<a href="mailto:dyoo@cs.wpi.edu">dyoo@cs.wpi.edu</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div class="im">> Nothing obvious, no. But Racket is designed to encourage programming without<br>
> mutation, and doubly linked lists require mutation.<br>
><br>
> It's very likely a zipper will do what you want. A zipper is much easier to<br>
> implement than a doubly linked list, and has similar performance and uses.<br>
<br>
<br>
</div>To supplement, here are very old notes I wrote to myself on the kind<br>
of list zipper that Neil is presenting:<br>
<br>
<a href="https://hkn.eecs.berkeley.edu/%7Edyoo/plt/zippers.txt" target="_blank">https://hkn.eecs.berkeley.edu/~dyoo/plt/zippers.txt</a><br>
<div><div></div><div class="h5">_________________________________________________<br>
For list-related administrative tasks:<br>
<a href="http://lists.racket-lang.org/listinfo/users" target="_blank">http://lists.racket-lang.org/listinfo/users</a><br>
</div></div></blockquote></div><br>