<div dir="ltr">The first/rest operations do not use a memoization table. They test using the list? primitive, which is built in and actually has a couple of tag bits reserved on every cons object for memoizing its results. So the operation really is quite fast.<br>
<div><div class="gmail_extra"><br clear="all"><div>Carl Eastlund</div>
<br><div class="gmail_quote">On Fri, Mar 7, 2014 at 4:40 PM, Eric Dong <span dir="ltr"><<a href="mailto:yd2dong@uwaterloo.ca" target="_blank">yd2dong@uwaterloo.ca</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
So if code is using first/rest instead of car/cdr when I already know the lists are proper, it could incur a significant performance penalty? After all, memoization still needs a table lookup each time I do a first/rest.<div>
<br></div><div>(i.e. implementing datastructures in terms of lists should use car/cdr for performance right? any benchmarks?)<div><div class="h5"><br><br>On Friday, March 7, 2014, Sean Kanaley <<a href="mailto:skanaley@gmail.com" target="_blank">skanaley@gmail.com</a>> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div>Pardon me, but going back a bit where the blog about switching to immutable lists was mentioned...I saw an interesting comment about immutability and eq?. Have any mathematicians come up with an answer for the meaning of eq? on permanently distinct but equivalent and immutable objects, e.g. (eq? (cons 3 2) (cons 3 2))? What about on immutable objects that have mutable internal state, e.g. memoizing functions? Naive-but-memoized (fib 1000) is not necessarily the same as (fib 1000), unless the answer doesn't depend on the number of universes that have bigbanged meanwhile.<br>
</div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Mar 7, 2014 at 2:31 PM, Daniel Carrera <span dir="ltr"><<a>dcarrera@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Thanks.</div><div class="gmail_extra"><br><br><div class="gmail_quote"><div>On 7 March 2014 20:22, Harry Spier <span dir="ltr"><<a>vasishtha.spier@gmail.com</a>></span> wrote:<br>
</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div dir="ltr">See also this previous thread on the Racket list.<div class="gmail_quote"><div dir="ltr">
<div dir="ltr">
<div style="font-size:12pt;font-family:'Calibri'">
<div><a title="http://www.mail-archive.com/users%40racket-lang.org/msg12161.html" href="http://www.mail-archive.com/users%40racket-lang.org/msg12161.html" target="_blank">http://www.mail-archive.com/users%40racket-lang.org/msg12161.html</a></div>
<div> </div>
<div> </div></div></div></div>
</div><br></div>
<br></div><div>____________________<br>
Racket Users list:<br>
<a href="http://lists.racket-lang.org/users" target="_blank">http://lists.racket-lang.org/users</a><br>
<br></div></blockquote></div><div><br><br clear="all"><div><br></div>-- <br>When an engineer says that something can't be done, it's a code phrase that means it's not fun to do.<br>
</div></div>
<br>____________________<br>
Racket Users list:<br>
<a href="http://lists.racket-lang.org/users" target="_blank">http://lists.racket-lang.org/users</a><br>
<br></blockquote></div><br></div>
</blockquote></div></div></div>
<br>____________________<br>
Racket Users list:<br>
<a href="http://lists.racket-lang.org/users" target="_blank">http://lists.racket-lang.org/users</a><br>
<br></blockquote></div><br></div></div></div>