IU-Match

PLT Scheme has a match command, but it's syntax is different from that used by Chez Scheme's match command. I won't go into the differences here, but suffice it to say, it would be a pain to convert (by hand) PLT match expressions back to Chez match expressions for assignments. (Of course, it would be trivial to write a Scheme program to do that, probably in under 20 lines too. But I'm lazy, in a good way (link forthcoming on the virtues of programming laziness..)

Matt Jadud, a former graduate student at IU, now working over in England at Kent, wrote a module for PLT Scheme that includes code to make IU's match command work with DrScheme. Matt says thanks to Matthew Flatt for his work on the IU match port. If you really want to see the PLT module file for this, it is here along with some other stuff Matt wrote including that big hariy monster that anyone in IUCS has had a run-in with called VINCENT!!! Anyway, Matt has put together a this package for PLT Scheme whose real purpose is to parse XML code in Scheme. But as a side benefit, it includes a PLT-compatible version of the IU matcher. Here are the instructions:

Two files are needed: This solution is known to work with the latest version of the PLT Scheme package (version 2.06p1) as well as the earlier version 2.0.5. The Language must be set to (at least) 'Textual' under the PLT tab, and not just the Standard (R5RS). The Standard language doesn't define the require procedure, which is needed to use the PLT module system. To set the language, select "Choose Language" under the "Language" menu, click on the line PLT if the PLT lanauges are not shown, click on "Textual (MzScheme, includes R5RS)", and click OK. You don't need to restart the program.

Place these two files inside the /collects/mzlib directory, which is inside the main PLT folder The only thing that is needed to use the IU-syntax match command is the following line at the top of the program:

(require (lib "iu-match.ss"))

Here is an exmaple program using the new match command:

(require (lib "iu-match.ss"))

(define computer
  (lambda (ls)
    (match ls
      [(,a) a]
      [(,a + ,b) (+ (computer (list a)) (computer (list b)))]
      [(,a - ,b) (- (computer (list a)) (computer (list b)))]
      [(,a * ,b) (* (computer (list a)) (computer (list b)))]
      [(,a / ,b) (/ (computer (list a)) (computer (list b)))])))

(computer '(1))
(computer '(3 + 5))
(computer '(9 * 3))

Dan Friedman's "Poor Man's" Logic System for Scheme with first-class relations

This is a really neat (and really dense) logic-programming environment for Scheme with first-class relations and transparent integration with normal Scheme functions and predicates. More information can be found in his 76-page monster on this here in PostScript format or here in a PDF version for those who don't have GhostScript installed.

Anyway, while written in RSR5 scheme, is written for the Chez Scheme enviornment primarily, and so has a two or three bits that are incompatible with the PLT MzScheme implementation of RSR5. The following files are modified to work with DrScheme:

The debugging functions (syntax definitions actually) are dbgfam, dbg, and dbgt, and bracket all "test code" calls, and rely on the following three debugging flags, defined at the beginning of pl.ss: