<br><br><div class="gmail_quote">On Thu, Sep 27, 2012 at 4:54 PM, Stephen Bloch <span dir="ltr"><<a href="mailto:bloch@adelphi.edu" target="_blank">bloch@adelphi.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
See <a href="http://worrydream.com/LearnableProgramming/" target="_blank">http://worrydream.com/LearnableProgramming/</a> . A lot of inspiring and interesting ideas about how an IDE can make programs more comprehensible.<br>
<br>
Some of these ideas could be incorporated into DrRacket fairly easily, e.g. abstracting a block of code by wrapping a function definition around it.<br></blockquote><div><br>Some of the realizations are amazing! I'm wondering how well all these nice features carry on to different cases though.<br>
</div><br></div>I've been willing to do something similar for some time now, too. You prodded me sufficiently to do that for variables (way simpler than what is presented on the website though!):<br><br>With the script-plugin package installed [1], create a new script and replace the template code with the following:<br>
#lang racket/gui<br><br>; Sample identity function:<br>;; string? -> (or/c string? #f)<br>(provide item-callback)<br>(define (item-callback str) <br> (define var (get-text-from-user "Variable Abstraction" "Variable name:"<br>
#:validate (ë(s)#t)))<br> (if var<br> (begin<br> (send the-clipboard set-clipboard-string <br> (string-append "(define " var " " str ")")<br>
0)<br> var)<br> str))<br><br><br>Save the file, and a new menu entry should appear in the Scripts menu.<br><br>The script in action: <a href="http://youtu.be/qgjAZd4eBBY">http://youtu.be/qgjAZd4eBBY</a><br>
<br>Not prodded enough to do it for functions yet ;)<br><br>Laurent<br><br>[1] <a href="http://planet.racket-lang.org/display.ss?package=script-plugin.plt&owner=orseau">http://planet.racket-lang.org/display.ss?package=script-plugin.plt&owner=orseau</a><br>
<br>