<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/'><id>tag:blogger.com,1999:blog-2080885971644496896.post1842888151218385802..comments</id><updated>2011-09-14T01:29:56.194-04:00</updated><category term='units'/><category term='xml'/><category term='structure properties'/><category term='futures'/><category term='web-server'/><category term='threads'/><category term='racketcon'/><category term='planet'/><category term='documentation'/><category term='contracts'/><category term='matthew'/><category term='keybindings'/><category term='macros'/><category term='continuations'/><category term='serialization'/><category term='drscheme'/><category term='typed-scheme'/><category term='scribble'/><category term='channels'/><category term='delimited continuations'/><category term='check syntax'/><category term='set'/><category term='interview'/><category term='tutorials'/><category term='self-reference'/><category term='script'/><category term='parallelism'/><category term='experience-reports'/><category term='scheme video'/><category term='oopsla'/><category term='release'/><category term='academic'/><category term='papers'/><category term='soft state'/><category term='industrial'/><title type='text'>Comments on The Racket Blog: Getting rid of set-car! and set-cdr!</title><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://blog.racket-lang.org/feeds/1842888151218385802/comments/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2080885971644496896/1842888151218385802/comments/default'/><link rel='alternate' type='text/html' href='http://blog.racket-lang.org/2007/11/getting-rid-of-set-car-and-set-cdr.html'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/2080885971644496896/1842888151218385802/comments/default?start-index=26&amp;max-results=25'/><author><name>Jens Axel Søgaard</name><uri>http://www.blogger.com/profile/15211030864341077735</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>32</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-2080885971644496896.post-1033332558673957124</id><published>2010-05-13T18:35:41.494-04:00</published><updated>2010-05-13T18:35:41.494-04:00</updated><title type='text'>Mike, mcons, mcar, mcdr, set-mcar!, and set-mcdr! ...</title><content type='html'>Mike, mcons, mcar, mcdr, set-mcar!, and set-mcdr! are provided by scheme already.  Just add (require scheme/mpair) to your definitions to get more mutable pair functionality.  You will need to use slightly different function names, e.g. mlist, mlength, etc.  The /scheme/mpair module is well documented.&lt;br /&gt;&lt;br /&gt;When I first wrote N-Queens, returning the solutions was a requirement.  So naturally I built the solutions with cons for later return.  After my earlier post, I realized that two additional lines of code would eliminate all cons operations.  Now, it doesn&amp;#39;t garbage collect until N = 17:&lt;br /&gt;&lt;br /&gt;&amp;gt; (begin (collect-garbage) (time (N-Queens 17)))&lt;br /&gt;cpu time: 6670485 real time: 6702624 gc time: 618&lt;br /&gt;95815104&lt;br /&gt;618ms time in gc while taking 1 hour and 51 minutes to determine 95,815,104 solutions isn&amp;#39;t bad.&lt;br /&gt;&lt;br /&gt;The key is:&lt;br /&gt;(else&lt;br /&gt;..(set-mcdr! prior-column (mcdr column))                    ..(set-mcdr! column solution)&lt;br /&gt;..(begin0&lt;br /&gt;....(next-queen safe-columns column new-count)&lt;br /&gt;....(set-mcdr! column (mcdr prior-column))&lt;br /&gt;....(set-mcdr! prior-column column)))&lt;br /&gt;&lt;br /&gt;Gene</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2080885971644496896/1842888151218385802/comments/default/1033332558673957124'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2080885971644496896/1842888151218385802/comments/default/1033332558673957124'/><link rel='alternate' type='text/html' href='http://blog.racket-lang.org/2007/11/getting-rid-of-set-car-and-set-cdr.html?showComment=1273790141494#c1033332558673957124' title=''/><author><name>Gene Snider</name><uri>http://www.blogger.com/profile/00423361760377955988</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.racket-lang.org/2007/11/getting-rid-of-set-car-and-set-cdr.html' ref='tag:blogger.com,1999:blog-2080885971644496896.post-1842888151218385802' source='http://www.blogger.com/feeds/2080885971644496896/posts/default/1842888151218385802' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-1741931929'/></entry><entry><id>tag:blogger.com,1999:blog-2080885971644496896.post-4751590959093246865</id><published>2010-04-14T17:01:12.269-04:00</published><updated>2010-04-14T17:01:12.269-04:00</updated><title type='text'>Way to go PLT Scheme 4.x.  You&amp;#39;ve just made it...</title><content type='html'>Way to go PLT Scheme 4.x.  You&amp;#39;ve just made it impossible for me to use your Scheme to work through the exercises in The Scheme Programming Language (4th edition) -- see for example Exercise 2.9.3 on page 55.&lt;br /&gt;&lt;br /&gt;As if learning a language like Scheme isn&amp;#39;t hard enough for us poor suckers trying to break out of the imperative/object world.  Do you really have to add yet more beautiful impediments?</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2080885971644496896/1842888151218385802/comments/default/4751590959093246865'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2080885971644496896/1842888151218385802/comments/default/4751590959093246865'/><link rel='alternate' type='text/html' href='http://blog.racket-lang.org/2007/11/getting-rid-of-set-car-and-set-cdr.html?showComment=1271278872269#c4751590959093246865' title=''/><author><name>Mike Taylor</name><uri>http://www.blogger.com/profile/06039663158335543317</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://www.miketaylor.org.uk/me.jpeg'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.racket-lang.org/2007/11/getting-rid-of-set-car-and-set-cdr.html' ref='tag:blogger.com,1999:blog-2080885971644496896.post-1842888151218385802' source='http://www.blogger.com/feeds/2080885971644496896/posts/default/1842888151218385802' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-1840057463'/></entry><entry><id>tag:blogger.com,1999:blog-2080885971644496896.post-8030956123270548537</id><published>2010-01-27T22:25:42.975-05:00</published><updated>2010-01-27T22:25:42.975-05:00</updated><title type='text'>I know this is an old, and probably dead thread, b...</title><content type='html'>I know this is an old, and probably dead thread, but I did want to respond to one post.&lt;br /&gt;&lt;br /&gt;----Quote----&lt;br /&gt;Robby said...&lt;br /&gt;...&lt;br /&gt;    But, in any case, these abstract arguments (either way) ultimately need to be backed up with real programs. Let me encourage you once again to provide some to back up your arguments. We have found none in a large body of code. Have you investigated a body of code and found some?&lt;br /&gt;    December 16, 2007 6:56 PM &lt;br /&gt;----End Quote----&lt;br /&gt;&lt;br /&gt;Over 25 years ago, I used set-cdr! in a PC Scheme implementation of N-Queens for an AI class.  Besides using set-cdr!, calls to move a queen were properly tail recursive.  I noticed the PLT Scheme benchmark didn&amp;#39;t use tail recursion for moves, so I modified my code to match the benchmark.  The following times compare the improvements for just using set-cdr! and for using set-cdr! combined with tail recursion:&lt;br /&gt;&lt;br /&gt;PLT Scheme Benchmark:&lt;br /&gt;&amp;gt; (begin (collect-garbage) (time (nqueens 15)))&lt;br /&gt;cpu time: 158899 real time: 158982 gc time: 16920&lt;br /&gt;2279184&lt;br /&gt;(execution time = cpu time - gc time = 142.0s)&lt;br /&gt;&lt;br /&gt;set-cdr! version:&lt;br /&gt;&amp;gt; (begin (collect-garbage) (time (N-Queens 15)))&lt;br /&gt;cpu time: 138616 real time: 138787 gc time: 3286&lt;br /&gt;2279184&lt;br /&gt;(execution time = cpu time - gc time = 135.3s)&lt;br /&gt;&lt;br /&gt;set-cdr! plus properly tail recursive moves:&lt;br /&gt;&amp;gt; (begin (collect-garbage) (time (N-Queens 15)))&lt;br /&gt;cpu time: 119845 real time: 120061 gc time: 3284&lt;br /&gt;2279184&lt;br /&gt;(execution time = cpu time - gc time = 116.5s)&lt;br /&gt;&lt;br /&gt;As you can see, using set-cdr! improved overall cpu time by about the same amount as using properly tail recursive moves.  The major performance improvement for set-cdr! came from reduced garbage collection.  N-Queens is just one example of back-tracking used to traverse a search space.  Any time the search space can be pruned before the back-tracking call is made, and restored on return from the call, set-cdr! should yield improved performance.  It&amp;#39;s also very localized, as shown by the following code snippet:&lt;br /&gt;&lt;br /&gt;(else&lt;br /&gt;..(set-mcdr! prior-column (mcdr column))&lt;br /&gt;..(begin0&lt;br /&gt;....(place&amp;amp;move safe-columns&lt;br /&gt;...........(mcdr safe-columns) safe-columns&lt;br /&gt;...........(cons (mcar column) solution) count)&lt;br /&gt;....(set-mcdr! prior-column column))))))&lt;br /&gt;&lt;br /&gt;In the above example, prior-column and column traverse the list, while safe-columns always points to it&amp;#39;s beginning.  The list is never copied, just manipulated with set-mcdr! as the search space is traversed.  Also, the list goes from 0 to N to simplify handling prior-column.&lt;br /&gt;&lt;br /&gt;Gene Snider</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2080885971644496896/1842888151218385802/comments/default/8030956123270548537'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2080885971644496896/1842888151218385802/comments/default/8030956123270548537'/><link rel='alternate' type='text/html' href='http://blog.racket-lang.org/2007/11/getting-rid-of-set-car-and-set-cdr.html?showComment=1264649142975#c8030956123270548537' title=''/><author><name>Gene Snider</name><uri>http://www.blogger.com/profile/00423361760377955988</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.racket-lang.org/2007/11/getting-rid-of-set-car-and-set-cdr.html' ref='tag:blogger.com,1999:blog-2080885971644496896.post-1842888151218385802' source='http://www.blogger.com/feeds/2080885971644496896/posts/default/1842888151218385802' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-1741931929'/></entry><entry><id>tag:blogger.com,1999:blog-2080885971644496896.post-4165866064900636153</id><published>2008-06-24T22:03:00.000-04:00</published><updated>2008-06-24T22:03:00.000-04:00</updated><title type='text'>T: You &lt;b&gt;do&lt;/b&gt; realize, don't you, that set-car!...</title><content type='html'>T: You &lt;B&gt;do&lt;/B&gt; realize, don't you, that set-car! and set-cdr! are still available in PLT Scheme 4.0, only as a library instead of as a built-in feature?  Given that, I don't see what you are so upset about.  You're free to use set-car! and set-cdr! as much as you want.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2080885971644496896/1842888151218385802/comments/default/4165866064900636153'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2080885971644496896/1842888151218385802/comments/default/4165866064900636153'/><link rel='alternate' type='text/html' href='http://blog.racket-lang.org/2007/11/getting-rid-of-set-car-and-set-cdr.html?showComment=1214359380000#c4165866064900636153' title=''/><author><name>Michael Vanier</name><uri>http://www.blogger.com/profile/00221993641853949677</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.racket-lang.org/2007/11/getting-rid-of-set-car-and-set-cdr.html' ref='tag:blogger.com,1999:blog-2080885971644496896.post-1842888151218385802' source='http://www.blogger.com/feeds/2080885971644496896/posts/default/1842888151218385802' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-1876755196'/></entry><entry><id>tag:blogger.com,1999:blog-2080885971644496896.post-8916174256639447592</id><published>2008-06-24T10:51:00.000-04:00</published><updated>2008-06-24T10:51:00.000-04:00</updated><title type='text'>T: In fact, *most* modern languages&lt;br&gt;dropped the...</title><content type='html'>T: In fact, *most* modern languages&lt;BR/&gt;dropped the number zero as a&lt;BR/&gt;pointer.  Most languages also&lt;BR/&gt;restrict you from using a ton of&lt;BR/&gt;other features, so which&lt;BR/&gt;implementation are you going to&lt;BR/&gt;install: C? assembler? maybe&lt;BR/&gt;you'll get a soldering iron?</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2080885971644496896/1842888151218385802/comments/default/8916174256639447592'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2080885971644496896/1842888151218385802/comments/default/8916174256639447592'/><link rel='alternate' type='text/html' href='http://blog.racket-lang.org/2007/11/getting-rid-of-set-car-and-set-cdr.html?showComment=1214319060000#c8916174256639447592' title=''/><author><name>Eli Barzilay</name><uri>http://www.blogger.com/profile/08165322672792335619</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://www.barzilay.org/images/eli1.jpg'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.racket-lang.org/2007/11/getting-rid-of-set-car-and-set-cdr.html' ref='tag:blogger.com,1999:blog-2080885971644496896.post-1842888151218385802' source='http://www.blogger.com/feeds/2080885971644496896/posts/default/1842888151218385802' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-1177241729'/></entry><entry><id>tag:blogger.com,1999:blog-2080885971644496896.post-3120226282552805395</id><published>2008-06-24T06:42:00.000-04:00</published><updated>2008-06-24T06:42:00.000-04:00</updated><title type='text'>Don't you just love it when language maintainers d...</title><content type='html'>Don't you just love it when language maintainers drop a feature because someone, somewhere, might misuse it?&lt;BR/&gt;&lt;BR/&gt;What's next? Dropping the number zero, because it can cause a divide-by-zero error? &lt;BR/&gt;&lt;BR/&gt;I'm de-installing PLT today and switching to an implementation which doesn't think I'm an idiot.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2080885971644496896/1842888151218385802/comments/default/3120226282552805395'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2080885971644496896/1842888151218385802/comments/default/3120226282552805395'/><link rel='alternate' type='text/html' href='http://blog.racket-lang.org/2007/11/getting-rid-of-set-car-and-set-cdr.html?showComment=1214304120000#c3120226282552805395' title=''/><author><name>T.</name><uri>http://www.blogger.com/profile/06234046154576035909</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.racket-lang.org/2007/11/getting-rid-of-set-car-and-set-cdr.html' ref='tag:blogger.com,1999:blog-2080885971644496896.post-1842888151218385802' source='http://www.blogger.com/feeds/2080885971644496896/posts/default/1842888151218385802' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-2027526738'/></entry><entry><id>tag:blogger.com,1999:blog-2080885971644496896.post-6423295391076542126</id><published>2008-01-26T22:05:00.000-05:00</published><updated>2008-01-26T22:05:00.000-05:00</updated><title type='text'>Existential Type: From this side of the fence I ca...</title><content type='html'>Existential Type: From this side of the fence I can say that Scheme covers all of ML, with all types that were and will be written.  But this is a second pointless flame, and still irrelevant to the context.  I could just as well point at the many limitations of ML types (eg, what's the &lt;I&gt;real&lt;/I&gt; type of map? sqrt? printf? collatz? GetFunction("foo","bar.dll")?).  But that's not going to do any good, so I'll stop replying.  Feel free to continue on the PLT list, or email me.&lt;BR/&gt;&lt;BR/&gt;Michael: I'm talking about several efforts that attempt to get the benefits of a dynamic language into a static language like ML.  There was some work done on reflecting types (or reifying types) which makes it possible to sort of package a value together with a type object (in the run-time sense; it becomes a value).  IIRC, there was also something related to universal types that goes in the same direction.&lt;BR/&gt;&lt;BR/&gt;Personally, I found that MLers who blindly bash Scheme for it's lack of types are just as bad as Schemers who blindly bash all static typing.  IMO (and in the opinion of many other good people I've talked to) there are very good advantages on both sides -- and the &lt;B&gt;real&lt;/B&gt; challenge is to get dynamic languages like Scheme to benefit from the advantages of statically typed languages like ML, &lt;B&gt;and&lt;/B&gt; vice versa.  Some people choose to work on just that (from either side), some people don't but appreciate those who do, and some people will inevitably continue to spit out useless comments even in a completely unrelated context, like the above anonymous poster.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2080885971644496896/1842888151218385802/comments/default/6423295391076542126'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2080885971644496896/1842888151218385802/comments/default/6423295391076542126'/><link rel='alternate' type='text/html' href='http://blog.racket-lang.org/2007/11/getting-rid-of-set-car-and-set-cdr.html?showComment=1201403100000#c6423295391076542126' title=''/><author><name>Eli Barzilay</name><uri>http://www.blogger.com/profile/08165322672792335619</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://www.barzilay.org/images/eli1.jpg'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.racket-lang.org/2007/11/getting-rid-of-set-car-and-set-cdr.html' ref='tag:blogger.com,1999:blog-2080885971644496896.post-1842888151218385802' source='http://www.blogger.com/feeds/2080885971644496896/posts/default/1842888151218385802' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-1177241729'/></entry><entry><id>tag:blogger.com,1999:blog-2080885971644496896.post-2138977282522777986</id><published>2008-01-26T21:30:00.000-05:00</published><updated>2008-01-26T21:30:00.000-05:00</updated><title type='text'>Eli, I agree with you about the pointlessness of a...</title><content type='html'>Eli, I agree with you about the pointlessness of an ML-vs-Scheme flame war.  Can you be more explicit about what you mean by "type reflection"?  That sounds interesting, but I have no idea what you're talking about.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2080885971644496896/1842888151218385802/comments/default/2138977282522777986'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2080885971644496896/1842888151218385802/comments/default/2138977282522777986'/><link rel='alternate' type='text/html' href='http://blog.racket-lang.org/2007/11/getting-rid-of-set-car-and-set-cdr.html?showComment=1201401000000#c2138977282522777986' title=''/><author><name>Michael</name><uri>http://www.blogger.com/profile/00221993641853949677</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.racket-lang.org/2007/11/getting-rid-of-set-car-and-set-cdr.html' ref='tag:blogger.com,1999:blog-2080885971644496896.post-1842888151218385802' source='http://www.blogger.com/feeds/2080885971644496896/posts/default/1842888151218385802' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-1876755196'/></entry><entry><id>tag:blogger.com,1999:blog-2080885971644496896.post-5921936266382113386</id><published>2008-01-26T19:59:00.000-05:00</published><updated>2008-01-26T19:59:00.000-05:00</updated><title type='text'>Eli, you seem forget that all Scheme fits into tin...</title><content type='html'>Eli, you seem forget that all Scheme fits into tiny corner of ML, namely a single recursive datatype.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2080885971644496896/1842888151218385802/comments/default/5921936266382113386'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2080885971644496896/1842888151218385802/comments/default/5921936266382113386'/><link rel='alternate' type='text/html' href='http://blog.racket-lang.org/2007/11/getting-rid-of-set-car-and-set-cdr.html?showComment=1201395540000#c5921936266382113386' title=''/><author><name>Existential Type</name><uri>http://www.blogger.com/profile/05595505123938492280</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.racket-lang.org/2007/11/getting-rid-of-set-car-and-set-cdr.html' ref='tag:blogger.com,1999:blog-2080885971644496896.post-1842888151218385802' source='http://www.blogger.com/feeds/2080885971644496896/posts/default/1842888151218385802' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-1554586342'/></entry><entry><id>tag:blogger.com,1999:blog-2080885971644496896.post-8726167489677370314</id><published>2008-01-26T19:41:00.000-05:00</published><updated>2008-01-26T19:41:00.000-05:00</updated><title type='text'>The conversion of my code took less than a day (ab...</title><content type='html'>The conversion of my code took less than a day (about 10000 lines, a guess, for I never counted the nr of lines) There are two types of instances in which I used set-cdr!: for assoclists and imperative queues. Assoclists now have become immutable lists of mutable pairs with a hybrid-assq procedure added. The imperative queues remain mutable lists, the cdr of the last pair being the only one being updated. My code did not contain anything like append! or reverse!. I found no trouble in swithing to v3.99.0.9. I say yes to the better conditions for optimization.&lt;BR/&gt;Jos Koot</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2080885971644496896/1842888151218385802/comments/default/8726167489677370314'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2080885971644496896/1842888151218385802/comments/default/8726167489677370314'/><link rel='alternate' type='text/html' href='http://blog.racket-lang.org/2007/11/getting-rid-of-set-car-and-set-cdr.html?showComment=1201394460000#c8726167489677370314' title=''/><author><name>jos koot</name><uri>http://www.blogger.com/profile/15016475158264198208</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.racket-lang.org/2007/11/getting-rid-of-set-car-and-set-cdr.html' ref='tag:blogger.com,1999:blog-2080885971644496896.post-1842888151218385802' source='http://www.blogger.com/feeds/2080885971644496896/posts/default/1842888151218385802' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-1904704957'/></entry><entry><id>tag:blogger.com,1999:blog-2080885971644496896.post-8573139025872795973</id><published>2008-01-25T23:27:00.000-05:00</published><updated>2008-01-25T23:27:00.000-05:00</updated><title type='text'>"Existential Type": your comment begs the exact sa...</title><content type='html'>"Existential Type": your comment begs the exact same reply with macros, except that five years is probably optimistic, and twenty years is an underestimate.  Or type reflection that maybe some day will get ML some of the advantages of Scheme.&lt;BR/&gt;&lt;BR/&gt;(But this is, of course, a pointless flame, just like your comment.  FWIW, the main issue is legacy code, and switching to Scheme with immutable lists is slightly easier than switching to ML.  At least for us Scheme freaks.)</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2080885971644496896/1842888151218385802/comments/default/8573139025872795973'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2080885971644496896/1842888151218385802/comments/default/8573139025872795973'/><link rel='alternate' type='text/html' href='http://blog.racket-lang.org/2007/11/getting-rid-of-set-car-and-set-cdr.html?showComment=1201321620000#c8573139025872795973' title=''/><author><name>Eli Barzilay</name><uri>http://www.blogger.com/profile/08165322672792335619</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://www.barzilay.org/images/eli1.jpg'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.racket-lang.org/2007/11/getting-rid-of-set-car-and-set-cdr.html' ref='tag:blogger.com,1999:blog-2080885971644496896.post-1842888151218385802' source='http://www.blogger.com/feeds/2080885971644496896/posts/default/1842888151218385802' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-1177241729'/></entry><entry><id>tag:blogger.com,1999:blog-2080885971644496896.post-1973578137297718209</id><published>2008-01-25T23:12:00.000-05:00</published><updated>2008-01-25T23:12:00.000-05:00</updated><title type='text'>In another five years or so you'll be where ML was...</title><content type='html'>In another five years or so you'll be where ML was twenty years ago!  Better late than never, I suppose, but, really, what is the point?</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2080885971644496896/1842888151218385802/comments/default/1973578137297718209'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2080885971644496896/1842888151218385802/comments/default/1973578137297718209'/><link rel='alternate' type='text/html' href='http://blog.racket-lang.org/2007/11/getting-rid-of-set-car-and-set-cdr.html?showComment=1201320720000#c1973578137297718209' title=''/><author><name>Existential Type</name><uri>http://www.blogger.com/profile/05595505123938492280</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.racket-lang.org/2007/11/getting-rid-of-set-car-and-set-cdr.html' ref='tag:blogger.com,1999:blog-2080885971644496896.post-1842888151218385802' source='http://www.blogger.com/feeds/2080885971644496896/posts/default/1842888151218385802' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-1554586342'/></entry><entry><id>tag:blogger.com,1999:blog-2080885971644496896.post-8446955628916610811</id><published>2007-12-28T09:39:00.000-05:00</published><updated>2007-12-28T09:39:00.000-05:00</updated><title type='text'>The problems you describe with mutability remind m...</title><content type='html'>The problems you describe with mutability remind me of type-theory where each kind of thing is separated into its own type.  Then you can always use the types in conjunction with each other if you need the functionality of both.&lt;BR/&gt;&lt;BR/&gt;For example, if you had the types `list' and `mutable' you could distinguish between an immutable list of immutable elements, an immutable list of mutable elements, a mutable list of immutable elements, and so on, and put this in your "contract system" (whatever that is).&lt;BR/&gt;&lt;BR/&gt;This not only documents the usage of things like mutability, but also allows the compiler (in theory) to check such constraints on inputs and outputs.&lt;BR/&gt;&lt;BR/&gt;When a function like `map' expects an immutable list, it will simply use the `list' type without restricting the mutation of elements.  But in places where that could be harmful, a different type can be used.  The conventional Scheme way of allowing everything to be mutable prevents this separation of distinct properties of values.&lt;BR/&gt;&lt;BR/&gt;I'm not too familiar with how Scheme implements things, but the general way this is done is to box things that are mutable.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2080885971644496896/1842888151218385802/comments/default/8446955628916610811'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2080885971644496896/1842888151218385802/comments/default/8446955628916610811'/><link rel='alternate' type='text/html' href='http://blog.racket-lang.org/2007/11/getting-rid-of-set-car-and-set-cdr.html?showComment=1198852740000#c8446955628916610811' title=''/><author><name>Jon T</name><uri>http://www.blogger.com/profile/06761280566170515580</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.racket-lang.org/2007/11/getting-rid-of-set-car-and-set-cdr.html' ref='tag:blogger.com,1999:blog-2080885971644496896.post-1842888151218385802' source='http://www.blogger.com/feeds/2080885971644496896/posts/default/1842888151218385802' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-2146659150'/></entry><entry><id>tag:blogger.com,1999:blog-2080885971644496896.post-3960889055134150547</id><published>2007-12-16T18:56:00.000-05:00</published><updated>2007-12-16T18:56:00.000-05:00</updated><title type='text'>Paul, this is not what I meant by concrete. No one...</title><content type='html'>Paul, this is not what I meant by concrete. No one said (or attempted to prove) that mutable cons cells were useless. Indeed, we still support them, but we just do not use them by default anymore.&lt;BR/&gt;&lt;BR/&gt;The comment "justifying mutable list removal because large classes of programs do not require them" misses half of the problem with mutable lists. The first half of the problem, in fact. Matthew's post clearly explains why mutable lists cause problems in concrete ways and, if you permit me to say so, makes a far more convincing abstract case against mutable pairs than your abstract arguments for them.&lt;BR/&gt;&lt;BR/&gt;But, in any case, these abstract arguments (either way) ultimately need to be backed up with real programs. Let me encourage you once again to provide some to back up your arguments. We have found none in a large body of code. Have you investigated a body of code and found some?</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2080885971644496896/1842888151218385802/comments/default/3960889055134150547'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2080885971644496896/1842888151218385802/comments/default/3960889055134150547'/><link rel='alternate' type='text/html' href='http://blog.racket-lang.org/2007/11/getting-rid-of-set-car-and-set-cdr.html?showComment=1197849360000#c3960889055134150547' title=''/><author><name>Robby</name><uri>http://www.blogger.com/profile/08402308775580442837</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='13' height='32' src='http://people.cs.uchicago.edu/~robby/portrait-2006.jpg'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.racket-lang.org/2007/11/getting-rid-of-set-car-and-set-cdr.html' ref='tag:blogger.com,1999:blog-2080885971644496896.post-1842888151218385802' source='http://www.blogger.com/feeds/2080885971644496896/posts/default/1842888151218385802' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-232663474'/></entry><entry><id>tag:blogger.com,1999:blog-2080885971644496896.post-837555612880103478</id><published>2007-12-16T18:45:00.000-05:00</published><updated>2007-12-16T18:45:00.000-05:00</updated><title type='text'>Somewhat more concrete: &lt;br&gt;&lt;br&gt;- presume the run-...</title><content type='html'>Somewhat more concrete: &lt;BR/&gt;&lt;BR/&gt;- presume the run-time creation, storage and/or retrieval of arbitrarily recursive list structured data is useful (or please prove otherwise).&lt;BR/&gt;&lt;BR/&gt;  (Personally see no value in presenting any particular program utilizing such capabilities, as the potential usefulness of such data structures representing state transition graphs, or more generally arbitrarily self recursive data representations are self evident; just as I see no value in any example given of how list mutation may yield indeterminate behavior in the absents of the specification of evaluation order; as overall the less flexible and deterministic a language is, the less useful it tends to be. Thereby I view dropping native mutable lists in an effort to improve determinism, in effect an attempt to improve a deficiency by removing utility; as opposed to improving its utility, by removing a deficiency.)&lt;BR/&gt;&lt;BR/&gt;Implying:&lt;BR/&gt;&lt;BR/&gt;- a facility to create/manipulate such data at run-time is required.&lt;BR/&gt;&lt;BR/&gt;  - mcons (and friends) are only rudimentarily facilitates, which exclusively operate on a now severely crippled data type because mutable lists have been alienated from the language (incompatible with car and friends) and thereby incompatible with the majority of all native list functions and thereby now require an entirely redundant and largely absent collection of functions to specified to operate on and utilize them (inclusive of their inability to be evaluated as code):&lt;BR/&gt;&lt;BR/&gt;- a facility to store and retrieve such data at run-time is required.&lt;BR/&gt;&lt;BR/&gt;  - as there is no current reader support to denote mutable lists:&lt;BR/&gt;&lt;BR/&gt;      - (mcons 'a '{b}) -&gt; {a . (b)} ; not {a b} as likely&lt;BR/&gt;        (cons  'a '(b)) -&gt; (a b)     ; expected by analogy&lt;BR/&gt;&lt;BR/&gt;      - (define x (mcons '+ (mcons 1 (mcons 2 null)))) ; i.e. {+ 1 2}&lt;BR/&gt;        (with-output-to-file "f" (lambda () (print x)) 'text 'replace)&lt;BR/&gt;        (with-input-from-file "f" (lambda () (read)))&lt;BR/&gt;        =&gt; (+ 1 2) ; wrong&lt;BR/&gt;&lt;BR/&gt;      - (define x (mcons 1 null)) (set-mcdr! x x) ; i.e. #0={1 . #0}&lt;BR/&gt;        (with-output-to-file "f" (lambda () (print x)) 'text 'replace)&lt;BR/&gt;        (with-input-from-file "f" (lambda () (read)))&lt;BR/&gt;       =&gt; #0=(1 . #0#) ; wrong&lt;BR/&gt;      &lt;BR/&gt;       [not to mention (define x '#0=(1 . #0#)) isn't accepted anymore]&lt;BR/&gt;&lt;BR/&gt;So overall, scheme absent mutable lists removes an entire class of capabilities which which was never proven to be useless, in fact arguably known to be otherwise, nor given analogous facilities of comparable utility.&lt;BR/&gt;&lt;BR/&gt;Yes, such facilities may be structured from non-native structured data types and a corresponding new set of support functions; just as in most languages; however scheme was previously unique in that such a capability was inherent. (while were at it, maybe list data types and functions should be removed entirely, as after all, they're not strictly necessary as evidenced by most all other languages).&lt;BR/&gt;&lt;BR/&gt;In hind sight, justifying mutable list removal because large classes of programs do not require them, or that the language's specification may be easier in their absents, or because the contract facility implementation isn't capable determining if list data is in fact potentially mutated; hardly seems reasonable. IMHO</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2080885971644496896/1842888151218385802/comments/default/837555612880103478'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2080885971644496896/1842888151218385802/comments/default/837555612880103478'/><link rel='alternate' type='text/html' href='http://blog.racket-lang.org/2007/11/getting-rid-of-set-car-and-set-cdr.html?showComment=1197848700000#c837555612880103478' title=''/><author><name>pschlie</name><uri>http://www.blogger.com/profile/02011776500958481158</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.racket-lang.org/2007/11/getting-rid-of-set-car-and-set-cdr.html' ref='tag:blogger.com,1999:blog-2080885971644496896.post-1842888151218385802' source='http://www.blogger.com/feeds/2080885971644496896/posts/default/1842888151218385802' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-2107069871'/></entry><entry><id>tag:blogger.com,1999:blog-2080885971644496896.post-1528989589056209297</id><published>2007-12-15T22:35:00.000-05:00</published><updated>2007-12-15T22:35:00.000-05:00</updated><title type='text'>The entire purpose of this experiment was to avoid...</title><content type='html'>The entire purpose of this experiment was to avoid caveats like "seems", "likely" and "potentially". If you have real examples to show, that would be interesting. So far we have far better abstract arguments against mutation than for it, and no concrete experience suggesting it should be brought back.&lt;BR/&gt;&lt;BR/&gt;Also, I should remind you that mcons (and friends) exist, as do mutable structs. These are as "native" as it gets.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2080885971644496896/1842888151218385802/comments/default/1528989589056209297'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2080885971644496896/1842888151218385802/comments/default/1528989589056209297'/><link rel='alternate' type='text/html' href='http://blog.racket-lang.org/2007/11/getting-rid-of-set-car-and-set-cdr.html?showComment=1197776100000#c1528989589056209297' title=''/><author><name>Robby</name><uri>http://www.blogger.com/profile/08402308775580442837</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='13' height='32' src='http://people.cs.uchicago.edu/~robby/portrait-2006.jpg'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.racket-lang.org/2007/11/getting-rid-of-set-car-and-set-cdr.html' ref='tag:blogger.com,1999:blog-2080885971644496896.post-1842888151218385802' source='http://www.blogger.com/feeds/2080885971644496896/posts/default/1842888151218385802' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-232663474'/></entry><entry><id>tag:blogger.com,1999:blog-2080885971644496896.post-190710874758406819</id><published>2007-12-15T22:30:00.000-05:00</published><updated>2007-12-15T22:30:00.000-05:00</updated><title type='text'>A little late, but ...&lt;br&gt;&lt;br&gt;Once one acknowledge...</title><content type='html'>A little late, but ...&lt;BR/&gt;&lt;BR/&gt;Once one acknowledges value of circular/recursive list data, it follows that there is likely value in the native runtime creation of such data as may be used for example to express arbitrarily recursively defined hierarchical information; which beyond the trivial, seems seems like a significant loss to the language to push such capability outside the baseline scope of the language by default.&lt;BR/&gt;&lt;BR/&gt;Yes, such capability may be defined and utilized as required although not as elegantly as if it were native; however it seems a shame to seriously consider alienating the previously native capability to dynamically formulate native list data from datum not known at program specification/compile time (i.e. the ability to formulate and manipulate such list datum from information extracted during run-time, as data bases typically are, can not be performed natively without set-car! set-cdr!, nor specified purely functionally); as the loss of such a potentially powerful and useful capability seems&lt;BR/&gt;like a poor trade in exchange for the questionable value of default immutable lists, especially as the mutability of function argument can most typically be easily determined within a function, and optimizations applied accordingly, and in the few cases where it can't, so what, presume it may be mutated. (If the concern is limited to map, then simply specify that map's arguments are presumed to not be mutated until terminated, or generally forbidden).</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2080885971644496896/1842888151218385802/comments/default/190710874758406819'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2080885971644496896/1842888151218385802/comments/default/190710874758406819'/><link rel='alternate' type='text/html' href='http://blog.racket-lang.org/2007/11/getting-rid-of-set-car-and-set-cdr.html?showComment=1197775800000#c190710874758406819' title=''/><author><name>pschlie</name><uri>http://www.blogger.com/profile/02011776500958481158</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.racket-lang.org/2007/11/getting-rid-of-set-car-and-set-cdr.html' ref='tag:blogger.com,1999:blog-2080885971644496896.post-1842888151218385802' source='http://www.blogger.com/feeds/2080885971644496896/posts/default/1842888151218385802' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-2107069871'/></entry><entry><id>tag:blogger.com,1999:blog-2080885971644496896.post-8263836778853855303</id><published>2007-11-27T11:32:00.000-05:00</published><updated>2007-11-27T11:32:00.000-05:00</updated><title type='text'>We have so far not changed the interaction of `con...</title><content type='html'>We have so far not changed the interaction of `cons' with `eq?' or `eqv?'. Specifically, `cons', `list', etc. are guaranteed to create fresh cons cells, in the sense that `eq?' distinguishes them, even though the cons cells are immutable. I think we may want to remove this guarantee eventually, because it would make some constant-folding optimizations easier and enable hash-consing, but we'll take one step at a time.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2080885971644496896/1842888151218385802/comments/default/8263836778853855303'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2080885971644496896/1842888151218385802/comments/default/8263836778853855303'/><link rel='alternate' type='text/html' href='http://blog.racket-lang.org/2007/11/getting-rid-of-set-car-and-set-cdr.html?showComment=1196181120000#c8263836778853855303' title=''/><author><name>Matthew Flatt</name><uri>http://www.blogger.com/profile/03369511886823036667</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.racket-lang.org/2007/11/getting-rid-of-set-car-and-set-cdr.html' ref='tag:blogger.com,1999:blog-2080885971644496896.post-1842888151218385802' source='http://www.blogger.com/feeds/2080885971644496896/posts/default/1842888151218385802' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-153773142'/></entry><entry><id>tag:blogger.com,1999:blog-2080885971644496896.post-2211927397510401424</id><published>2007-11-27T11:27:00.000-05:00</published><updated>2007-11-27T11:27:00.000-05:00</updated><title type='text'>On replacing set! with set-box!: in a sense, this ...</title><content type='html'>On replacing set! with set-box!: in a sense, this is so easy that the compiler does it automatically. That is, mutable variables are already implemented via boxes. You always know statically whether a variable needs to be boxed and unboxed due to lexical scope plus rules on mutating module-defined identifiers. For essentially the same reason, `set!' doesn't really cause much trouble; programmers usually see `set!'s and know to treat the relevant variable with care --- in contrast with `set-car!'s, which could be in a library that you don't see.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2080885971644496896/1842888151218385802/comments/default/2211927397510401424'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2080885971644496896/1842888151218385802/comments/default/2211927397510401424'/><link rel='alternate' type='text/html' href='http://blog.racket-lang.org/2007/11/getting-rid-of-set-car-and-set-cdr.html?showComment=1196180820000#c2211927397510401424' title=''/><author><name>Matthew Flatt</name><uri>http://www.blogger.com/profile/03369511886823036667</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.racket-lang.org/2007/11/getting-rid-of-set-car-and-set-cdr.html' ref='tag:blogger.com,1999:blog-2080885971644496896.post-1842888151218385802' source='http://www.blogger.com/feeds/2080885971644496896/posts/default/1842888151218385802' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-153773142'/></entry><entry><id>tag:blogger.com,1999:blog-2080885971644496896.post-6249512446486746398</id><published>2007-11-27T11:12:00.000-05:00</published><updated>2007-11-27T11:12:00.000-05:00</updated><title type='text'>Wow, did I make a mistake.&lt;br&gt;&lt;br&gt;&lt;b&gt;Background.&lt;/...</title><content type='html'>Wow, did I make a mistake.&lt;BR/&gt;&lt;BR/&gt;&lt;B&gt;Background.&lt;/B&gt; In PLT Redex, the stepper uses mutable lists to represent the currently visible portion of the reduction graph. When someone clicks the "next" button, it does a set-cdr! to add something to the end of that graph.&lt;BR/&gt;&lt;BR/&gt;&lt;B&gt;The Mistake.&lt;/B&gt; When I converted the code to v4, I figured that I should preserve the mutation, so I went in and changed a few set-car!s to set-mcar!s and then changed about 15 or 20 uses of filter, for-each, ormap, list-ref, and friends to versions of those that worked on mutable pairs instead of immutable ones. This took about 2 hours.&lt;BR/&gt;&lt;BR/&gt;Not too bad, you might think. Two hours? Sometimes fixing one little bug can take longer than that, days even. Got away cheaply, you might think ...&lt;BR/&gt;&lt;BR/&gt;&lt;B&gt;What I Should Have Done.&lt;/B&gt; Today I decided that I wanted the code to work in both v4 and in earlier versions of PLT Scheme, since the code'll be on PLaneT, after all and not everyone is using v4 yet. Sigh. So now I need to go undo that work and copy the list instead of mutating its tail. So I did that.&lt;BR/&gt;&lt;BR/&gt;5 minutes. Done. Working code.&lt;BR/&gt;&lt;BR/&gt;10 more minutes: removing all of the now useless helper functions that dealt with the mutable-pair versions of filter, for-each, ormap, list-ref. &lt;BR/&gt;&lt;BR/&gt;Oh well. Lesson learned, I suppose.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2080885971644496896/1842888151218385802/comments/default/6249512446486746398'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2080885971644496896/1842888151218385802/comments/default/6249512446486746398'/><link rel='alternate' type='text/html' href='http://blog.racket-lang.org/2007/11/getting-rid-of-set-car-and-set-cdr.html?showComment=1196179920000#c6249512446486746398' title=''/><author><name>Robby</name><uri>http://www.blogger.com/profile/08402308775580442837</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='13' height='32' src='http://people.cs.uchicago.edu/~robby/portrait-2006.jpg'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.racket-lang.org/2007/11/getting-rid-of-set-car-and-set-cdr.html' ref='tag:blogger.com,1999:blog-2080885971644496896.post-1842888151218385802' source='http://www.blogger.com/feeds/2080885971644496896/posts/default/1842888151218385802' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-232663474'/></entry><entry><id>tag:blogger.com,1999:blog-2080885971644496896.post-4689625353064758738</id><published>2007-11-26T16:14:00.000-05:00</published><updated>2007-11-26T16:14:00.000-05:00</updated><title type='text'>Are you considering changing the behaviour of eq? ...</title><content type='html'>Are you considering changing the behaviour of eq? or eqv? on (now immutable) pairs? Currently, two immutable pairs whose cars and cdrs are eq? can only be distinguished by eq? or eqv?. As such, should they really be considered to be distinct or is their apparent distinctiveness simply an artifact of the implementation that should be hidden from the programmer?</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2080885971644496896/1842888151218385802/comments/default/4689625353064758738'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2080885971644496896/1842888151218385802/comments/default/4689625353064758738'/><link rel='alternate' type='text/html' href='http://blog.racket-lang.org/2007/11/getting-rid-of-set-car-and-set-cdr.html?showComment=1196111640000#c4689625353064758738' title=''/><author><name>Alan Watson</name><uri>http://www.blogger.com/profile/05673202598799658808</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://www.alan-watson.org/me.jpg'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.racket-lang.org/2007/11/getting-rid-of-set-car-and-set-cdr.html' ref='tag:blogger.com,1999:blog-2080885971644496896.post-1842888151218385802' source='http://www.blogger.com/feeds/2080885971644496896/posts/default/1842888151218385802' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-490412989'/></entry><entry><id>tag:blogger.com,1999:blog-2080885971644496896.post-7722090637948041934</id><published>2007-11-21T13:18:00.000-05:00</published><updated>2007-11-21T13:18:00.000-05:00</updated><title type='text'>How difficult would it be to replace set! with exp...</title><content type='html'>How difficult would it be to replace set! with explicit boxes?</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2080885971644496896/1842888151218385802/comments/default/7722090637948041934'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2080885971644496896/1842888151218385802/comments/default/7722090637948041934'/><link rel='alternate' type='text/html' href='http://blog.racket-lang.org/2007/11/getting-rid-of-set-car-and-set-cdr.html?showComment=1195669080000#c7722090637948041934' title=''/><author><name>Ethan Aubin</name><uri>http://www.blogger.com/profile/03726030135568605285</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.racket-lang.org/2007/11/getting-rid-of-set-car-and-set-cdr.html' ref='tag:blogger.com,1999:blog-2080885971644496896.post-1842888151218385802' source='http://www.blogger.com/feeds/2080885971644496896/posts/default/1842888151218385802' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-1504755151'/></entry><entry><id>tag:blogger.com,1999:blog-2080885971644496896.post-7665183598856724025</id><published>2007-11-18T16:15:00.000-05:00</published><updated>2007-11-18T16:15:00.000-05:00</updated><title type='text'>Did not observe any problem beyond the typical usa...</title><content type='html'>Did not observe any problem beyond the typical usages noted in the article when I moved SSAX and SXML to R6RS libraries.&lt;BR/&gt;&lt;BR/&gt;Typical use is in implementing "efficient" queues.  I expect an applicative queue such as found in Okasaki would work fine on modern hardware and scheme implementations.&lt;BR/&gt;&lt;BR/&gt;I doubt there is a systemic problem out there.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2080885971644496896/1842888151218385802/comments/default/7665183598856724025'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2080885971644496896/1842888151218385802/comments/default/7665183598856724025'/><link rel='alternate' type='text/html' href='http://blog.racket-lang.org/2007/11/getting-rid-of-set-car-and-set-cdr.html?showComment=1195420500000#c7665183598856724025' title=''/><author><name>GreyLensman</name><uri>http://www.blogger.com/profile/12063637186335293030</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.racket-lang.org/2007/11/getting-rid-of-set-car-and-set-cdr.html' ref='tag:blogger.com,1999:blog-2080885971644496896.post-1842888151218385802' source='http://www.blogger.com/feeds/2080885971644496896/posts/default/1842888151218385802' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-565507809'/></entry><entry><id>tag:blogger.com,1999:blog-2080885971644496896.post-6407965856943920959</id><published>2007-11-18T00:55:00.000-05:00</published><updated>2007-11-18T00:55:00.000-05:00</updated><title type='text'>Well, I've been online now for over 30 minutes, an...</title><content type='html'>Well, I've been online now for over 30 minutes, and AFAIK, I haven't been hacked.  This is a banner day.  Hi Matt; great article!  Out of necessity, from a security standpoint, I have converted all my boxes to some flavor of *nix.  As soon as I can download 3.99, I'll try to reproduce the flavor of the data from my flatten benchmark article.  This time it will be different, simply because they'll be on a new OS.  However, I have a bunch of varients of the flatten algorithm, using both muttable and immutable methods.  As I recall from my earlier results, the biggest difference advantage to using mutation came about when a poor algorithm had been choosen to begin with, that required the reversal of the result list.  These quite substantially improved their performance with the use of reverse!   However, the more elegant functional solutions, under favorable conditions, actually out performed even the fastest mutable algorithms.  Not typically, but definitely always in the race.  The success of building functional solutions, which are also efficient is certainly achieved with other functional languages.  I'll have to redesign my queue routine, as you mentioned, but it will be worth the effort.  I'm looking forward to getting a copy on my box as soon as possible.&lt;BR/&gt;&lt;BR/&gt;Take care.&lt;BR/&gt;&lt;BR/&gt;--kylr</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2080885971644496896/1842888151218385802/comments/default/6407965856943920959'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2080885971644496896/1842888151218385802/comments/default/6407965856943920959'/><link rel='alternate' type='text/html' href='http://blog.racket-lang.org/2007/11/getting-rid-of-set-car-and-set-cdr.html?showComment=1195365300000#c6407965856943920959' title=''/><author><name>Kyle Smith</name><uri>http://www.blogger.com/profile/05673570688024190864</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='20' height='32' src='http://i202.photobucket.com/albums/aa98/airfoil/KyleWithAmphibico.jpg'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.racket-lang.org/2007/11/getting-rid-of-set-car-and-set-cdr.html' ref='tag:blogger.com,1999:blog-2080885971644496896.post-1842888151218385802' source='http://www.blogger.com/feeds/2080885971644496896/posts/default/1842888151218385802' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-748876714'/></entry><entry><id>tag:blogger.com,1999:blog-2080885971644496896.post-8692827520331669120</id><published>2007-11-13T22:16:00.000-05:00</published><updated>2007-11-13T22:16:00.000-05:00</updated><title type='text'>Yes. Version 3.99.0.2 has `make-reader-graph' for ...</title><content type='html'>Yes. Version 3.99.0.2 has `make-reader-graph' for creating cycles built from immutable pairs. We need a better name, but the current name reflects that `read' still supports the #n= and #n# graph notation. (We've dropped support for cyclic syntax objects, though, so `read-syntax' no longer supports the graph notation).</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/2080885971644496896/1842888151218385802/comments/default/8692827520331669120'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/2080885971644496896/1842888151218385802/comments/default/8692827520331669120'/><link rel='alternate' type='text/html' href='http://blog.racket-lang.org/2007/11/getting-rid-of-set-car-and-set-cdr.html?showComment=1195010160000#c8692827520331669120' title=''/><author><name>Matthew Flatt</name><uri>http://www.blogger.com/profile/03369511886823036667</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.racket-lang.org/2007/11/getting-rid-of-set-car-and-set-cdr.html' ref='tag:blogger.com,1999:blog-2080885971644496896.post-1842888151218385802' source='http://www.blogger.com/feeds/2080885971644496896/posts/default/1842888151218385802' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-153773142'/></entry></feed>
