[DrScheme logo] DrScheme Release Notes

Current Release: 0.41.
Release Date: April 16, 1996.

The following is a list of differences between this release and the previous one.

Highlights

A mail alias has been created for reporting bugs. Bug reports for DrScheme (and other PLT software) should be sent to:
    plt-bugs@cs.rice.edu

The error messages in DrScheme have been improved and should now be more descriptive of the problem.

Several changes to the MzScheme language affecting the class system, exceptions and macros have been made in release 0.41. Many of the new features are incompatible with the old system.

Classes

`make-class' and `make-class*' have been replaced with `class' and `class*'. `class' looks a lot like `make-class', but there are some important differences:
  1. The initialization procedure of `make-class' is gone. Instead, in `class', there is always an implicit `lambda' (really something like an `opt-lambda'). As a result, the arguments to `make-object' can be used in the ivar initialization expressions.
  2. All ivars are intialized in order, even across clauses.
  3. A new kind of clause is available: `sequence' clauses evaluate expressions without assigning them to ivars.
  4. The scope of `super-init' includes all of the clauses now. (It used to be only the initialization procedure.)
  5. apply-super-init is gone. Use (apply super-init ...) instead.

For example, this expression:

  (make-class c%
    (private y)
    (public [x (lambda () y)])
    (lambda (v)
      (set! y v)
      (super-init)))
can now be written:
  (class c% (v) ; (v) is the arg list for the implicit lambda
    (private [y v])
    (public [x (lambda () y)])
    (sequence
      (super-init)))
or even better:
  (class c% (y)
    (public [x (lambda () y)])
    (sequence
      (super-init)))
This expression:
  (make-class d%
    (public [x 5]))
translates to:
  (class d% args
    (public [x 5])
    (sequence
      (apply super-init args)))
Since this happens a lot, mzlib's `macros.ss' defines `class-asi' (auto super init):
  (class-asi d%
    (public [x 5]))
(Here, `make-class' was simply changed to `class-asi'.)

Default expressions can be provided for `make-object' arguments (`opt-lambda' style):

  (class x% (a [b (add1 a)] [c (lambda (x) b)])
    ...)
Each default value expression is not evaluated when an argument is supplied. The scope of all argument variables includes all default value expressions (i.e., like `letrec', while `opt-lambda' is like `let*').

Exceptions

Errors are now always signaled using exceptions. The `raise' procedure takes any value and invokes the current exception handler with that value. All primitive errors invoke `raise' with an instance of the struct type `exn'. There is always a current exception handler, just as there has previously been a current error handler in MzScheme. (The current error display and escape handlers are still used by the default eception handler). A `with-handlers' form provides ML-like syntax for handling exceptions in a subexpression.

Macros

`defmacro' and `letmacro' have been replaced with `define-macro' and `let-macro'. The only difference is that the implicit `lambda' must now be explicit: (defmacro when (test . body) `(if ,test (begin ,@body))) becomes (define-macro when (lambda (test . body) `(if ,test (begin ,@body)))) mzlib's `compat.ss' defines macros for `defmacro' and `letmacro'.

Package Macro

The `package' macro in mzlib's "macros.ss" has been renamed to `define-some' to avoid confusion with DrScheme's `make-package' form.

Error Messages

The error messages from MzScheme have been revised. Hopefully, the syntax error messages will now be more helpful.