[plt-scheme] SIW: Capture-avoiding paste

From: Eli Barzilay (eli at barzilay.org)
Date: Mon Jan 25 23:18:54 EST 2010

On Jan 23, Neil Toronto wrote:
> Strange Idea of the Week
> 
> Sensei and I were chatting a couple of days ago, and we thought it
> would be pretty cool if, when you pasted things in the DrScheme
> editor, it did some moral equivalent to capture-avoiding
> substitution. This would require at minimum (I think) some kind of
> incremental Check Syntax that was somewhat robust to
> bad/incomplete/partial syntax. It would necessarily be a
> conservative approximation. Without expanding macros, it would be
> impossible to tell what the binding forms are, and macros can't be
> expanded on illegal syntax.
> 
> I haven't got a clue why it would be cool, apart from being able to
> reason about your own code by doing copy-and-paste, and be sure that
> you haven't messed something up. Maybe the algebraic stepper in the
> module language is what I really want most of the time, but I still
> think this would be cool.

This sounds somewhat related to the concept of concrete abstractions,
where you use a values from a specific domain as the variables.  If
you take this to an extreme, you can imagine a system where typing `x'
twice gives you two different identifiers, and copy+paste is the only
way to get bindings...  But it's a question how interaction will look
in such a system -- are you allowed to copy an expression from the
body of a function but not the binders?  (The bottom line, IMO, is
that flat text is ultimately more convenient to manage, for people who
can deal with such a level of abstraction.  (A category that I'd like
to think as including all programmers.))

-- 
          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
                    http://barzilay.org/                   Maze is Life!


Posted on the users mailing list.