Q:

How do you halt in DrScheme's implementation of R5RS?

When using DrScheme with R5RS, there is no error function. I plan to write my own, but can't figure out how to halt the program execution. I tried commands such as:

(halt) 
(exit) 
(error)

and none worked. How do you halt program execution?

A:

SLIB (the portable Scheme library) has an implementation of ERROR. You might want to either look at that, or use SLIB in your programs.
Other than that, one way to halt the program is simply to raise a different error! Try something like this (thanks to Stephen Houben):
(define (error reason . args)
      (display "Error: ")
      (display reason)
      (for-each (lambda (arg) 
                  (display " ")
          (write arg))
        args)
      (newline)
      (scheme-report-environment -1))  ;; we hope that this will signal an error

While this does raise a second (unrelated) error, it will surely halt program execution.

