DrRacket EOPL Scheme output

给你一囗甜甜゛ 提交于 2019-12-06 03:51:49

Looks like #lang eopl uses #%plain-module-begin, which does not print results, instead of #%module-begin, which does print results.

For a quick way to switch, create the following file with the following contents:

eopl-printing.rkt:

#lang racket
(require (except-in eopl #%module-begin))
(provide (all-from-out eopl))
(provide #%module-begin)

Then use this as the language in another file:

#lang s-exp "eopl-printing.rkt"
1
2
3

produces in my DrRacket:

Welcome to DrRacket, version 5.3.4.6 [3m].
Language: s-exp "eopl-printing.rkt" [custom].
1
2
3
> 

CAVEAT: If eopl was hiding the results for a reason, then you may get some spurious output, but I don't know for sure.

A possible workaround: print the value in the definitions pane, so it'll show up in the interactions pane. And use newline to separate lines:

(write 4)
(newline)
(write 2)

> 4
> 2

Of course, it'll be tedious if you want to display many values, but it's an improvement.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!