[racket] an interesting article on IDE's for education

From: Laurent (laurent.orseau at gmail.com)
Date: Thu Sep 27 12:01:14 EDT 2012

On Thu, Sep 27, 2012 at 4:54 PM, Stephen Bloch <bloch at adelphi.edu> 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
        (send the-clipboard set-clipboard-string
              (string-append "(define " 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 ;)


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20120927/a1e17c30/attachment.html>

Posted on the users mailing list.