Cute.
On Sep 27, 2012, at 12:01 PM, Laurent wrote: > > > On Thu, Sep 27, 2012 at 4:54 PM, Stephen Bloch <[email protected]> wrote: > See http://worrydream.com/LearnableProgramming/ . A lot of inspiring and > interesting ideas about how an IDE can make programs more comprehensible. > > 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. > > Some of the realizations are amazing! I'm wondering how well all these nice > features carry on to different cases though. > > 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!): > > With the script-plugin package installed [1], create a new script and replace > the template code with the following: > #lang racket/gui > > ; Sample identity function: > ;; string? -> (or/c string? #f) > (provide item-callback) > (define (item-callback str) > (define var (get-text-from-user "Variable Abstraction" "Variable name:" > #:validate (λ(s)#t))) > (if var > (begin > (send the-clipboard set-clipboard-string > (string-append "(define " var " " str ")") > 0) > var) > str)) > > > Save the file, and a new menu entry should appear in the Scripts menu. > > The script in action: http://youtu.be/qgjAZd4eBBY > > Not prodded enough to do it for functions yet ;) > > Laurent > > [1] > http://planet.racket-lang.org/display.ss?package=script-plugin.plt&owner=orseau > > ____________________ > Racket Users list: > http://lists.racket-lang.org/users ____________________ Racket Users list: http://lists.racket-lang.org/users

