Mr Ed Designer: Generating User Interfaces with PLT Scheme

PLT Scheme’s user interface library is called Mr Ed. It is used to provide DrScheme to thousands of computers running Windows, Mac OS, and UNIX. It “just works”, and does so well; it is a fine graphics toolkit. MrEd Designer aims to make Mr Ed even easier to use!
Addendum: 7/14/8:
Peter Ivanyi now maintains this application.
Addendum: 09/10/08:
MrEd Designer 2.1.2 is released; it now supports tab-panels.
Addendum: 09/20/08
In MrEd Designer 2.1.3:

  • tooltips are added for the main buttons
  • the no-border style for the tab-panels is fixed.

Caveats of Object Creation using Closures

At one time or another you have probably heard the claim made that since you can utilize closures while programming in Lisp, there is no need to utilize an object system. That claim is sort of a half-truth. While closures are the language construct that allow you to create objects, they certainly don’t provide you with all of the object oriented programming language features that you would expect. Instead, you need to implement those features yourself.
The question was posed on the PLT discussion list. Some very good points were made about the issues you must address when implementing such an object system yourself, along with a pointer detailing how the issues are addressed in PLT Scheme.

Type Conversion with Eiffel

If you are going to utilize the Object Oriented paradigm for implementing your system, you ought to do yourself a favor and learn the Eiffel programming language. Why?
Take all of the things that are not included in your statically-typed OO language of choice because they are “too hard to understand”, and visit them in Eiffel. Not only does it have all of those features, but it makes them easy both to understand and utilize.
Read about type conversion, for example. What a wonderful language feature. You can even use tuples!
You will be left scratching your head, wondering why no one else has features like this (among many others).
Eiffel is really a gem of a language!

Nonstandard Interpretation with Scheme

In response to this excellent blog post by Dave Herman, Jay McCarthy pointed the reader to this interesting paper about creating a language construct that allows you to modularly redefine how your code (that you may or may not have written) gets evaluated (in other words, nonstandard interpretation).
Nonstandard interpretation

is a powerful and useful construct that supports such tasks as tracing, security logging, sandboxing, error checking, profiling, code instrumentation and metering, run-time code patching, and resource monitoring.

Obviously, these things aren’t new features. You can probably already perform nonstandard interpretation using your language of choice.
The interesting thing about this approach is that rather than performing compile time environment or code manipulation, a new language feature is applied to perform the non standard interpretation at runtime.
While both will get you to the place that you want to go; only the latter offers you an opportunity to build a conceptual framework for understand how you reached your destination. Neat!

Distributed Programming in Scheme

Here are two places to start with distributed programming in Scheme:
Termite
Dimitris Vyzovitis’s patch for revision 8983 (of trunk) in PLT Scheme
Addendum 03/21/08

  • Dimitris’ patch for additional mailbox functionality.

Addendum 04/26/08

Addendum 06/24/08
I’m pretty sure this patch has made it into the main source branch.

DrScheme: Insert Lambda Template Keybinding

DrScheme provides a very versatile keybinding system. Out of the box you get bindings that make it very easy to navigate and even refactor your code. One keybinding, insert-lambda-template, works by surrounding the selected code with a lambda function. By default, insert-lambda-template uses the lowercase lambda symbol λ rather than the word lambda. As DrScheme encodes its files in utf-8 it has got no problems with this (in fact DrScheme has shortcuts for inserting most other Greek characters), but if you use other tools to edit or process your source code you may find that they (quite disappointingly) choke on it. For that reason, I wanted to modify the keybinding so that it would use the world lambda rather than the symbol. There are two ways to go about doing this.
The first involves modifying the source code of DrScheme itself. This sounds harder than it is as it doesn’t even involve downloading the source code. When you install DrScheme, it includes a number of source files used to customize itself. If you wanted, you could look up this keybinding, change it, and re-run the setup program. I don’t like this approach, though, since it forces the user to re-build part of the program. That leaves us with the second alternative, a custom keybinding.
A custom keybinding is easy to implement and add. To write it, I copied the definition of insert-lambda-template and changed the lambda symbol to the word lambda. Next, I went through DrScheme’s Edit->Keybindings menu to select Add User-defined Keybinding. That is all it takes.
My keybinding file can be downloaded here.

DrSync: Automatically synchronize file changes in DrScheme v370 and above

DrSync is a plugin that saves your files on frame deactivation and reverts them on frame activation. This tool is of particular interest to folks who run external programs like version control or build related tools on files which they are editing inside of DrScheme.
Continue reading “DrSync: Automatically synchronize file changes in DrScheme v370 and above”