Thank you very much, that looks good.<br><br>Laurent<br><br><div class="gmail_quote">On Tue, Aug 30, 2011 at 17:08, Sam Tobin-Hochstadt <span dir="ltr"><<a href="mailto:samth@ccs.neu.edu">samth@ccs.neu.edu</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">I think there are some purely functional data structures that you can<br>
use here. Two examples:<br>
<br>
- Random Access Lists implemented in Hari Prashanth's Typed Purely<br>
Functional Data Structures [1]<br>
Some of the other data structures here, such as VLists, may also be helpful.<br>
<br>
- David Van Horn's RAList package [2]<br>
<br>
[1] <a href="http://planet.plt-scheme.org/package-source/krhari/pfds.plt/1/5/planet-docs/functional-data-structures/Random_Access_Lists.html" target="_blank">http://planet.plt-scheme.org/package-source/krhari/pfds.plt/1/5/planet-docs/functional-data-structures/Random_Access_Lists.html</a><br>
[2] <a href="http://planet.racket-lang.org/display.ss?package=ralist.plt&owner=dvanhorn" target="_blank">http://planet.racket-lang.org/display.ss?package=ralist.plt&owner=dvanhorn</a><br>
<div><div></div><div class="h5"><br>
On Tue, Aug 30, 2011 at 3:18 AM, Laurent <<a href="mailto:laurent.orseau@gmail.com">laurent.orseau@gmail.com</a>> wrote:<br>
> Thank you very much for this nice intermediate solution, though I need<br>
> constant-time append, split, insert, remove, + pointers to items, etc.<br>
> 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<br>
> 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<br>
> growing memory but with frequent removal of selected items. If I have time<br>
> to get there.<br>
><br>
> I'll keep the zipper in mind for other purposes though!<br>
><br>
> Laurent<br>
><br>
> On Tue, Aug 30, 2011 at 08:35, Danny Yoo <<a href="mailto:dyoo@cs.wpi.edu">dyoo@cs.wpi.edu</a>> wrote:<br>
>><br>
>> > Nothing obvious, no. But Racket is designed to encourage programming<br>
>> > 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<br>
>> > to<br>
>> > implement than a doubly linked list, and has similar performance and<br>
>> > uses.<br>
>><br>
>><br>
>> 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>
>> _________________________________________________<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>
><br>
><br>
> _________________________________________________<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>
><br>
<br>
<br>
<br>
</div></div><font color="#888888">--<br>
sam th<br>
<a href="mailto:samth@ccs.neu.edu">samth@ccs.neu.edu</a><br>
</font></blockquote></div><br>