[previous] [up] [next]     [contents] [index]
Next: Libraries Up: Language Reference Previous: MrEd Toolbox

Printer

DrScheme's contructors style printer treats cons, vector, and similar primitives as value constructors, rather than functions. It also treats list as shorthand for multiple cons's ending with the null list. So, when values are printed, they look different from usual scheme implementations. This table details all of the differences between MzScheme's and DrScheme's printed values.

tabular1148

DrScheme's printer can be confusing if you are accustomed to the traditional Scheme printer. Just remember that the output syntax for drscheme matches the standard Scheme input syntax.

The printer is not as useful if you are using s-expressions to represent programs. For example, the value '(lambda (x) (lambda (y) (+ x y))) will print as

(lambda (x) (lambda (y) (+ x y)))

in MzScheme, but will print as

(list 'lambda (list 'x) (list 'lambda (list 'y) (list '+ 'x 'y)))

in DrScheme. For those programs, you should use the Quasiquote style printer. Use the Language tex2html_wrap_inline6218 Configure Language dialog to change the printer style. The Quasiquote style printer uses quasiquote to print lists, and uses unquote to escape back to constructor style printing for non-lists, and non-symbols. The above example prints as: `(lambda (x) (lambda (y) (+ x y)))


PLT