How could I allow students to use read and display in BSL?
I've tried (require (only-in racket/base read)) but get an error saying that the module has to be a string or a lib or planet form.
I know why they're not provided in BSL and I mostly agree with that reasoning, but when you're trapped by an AP curriculum that thinks they're a fundamental part of what programming and computation are, you have to adapt. Basically, I have rubrics that specify that input and output have to be external to the program itself, so students wouldn't get full credit for a test case, but would if they read the check and display the expect.
What we've been doing is to provide our own lib.rkt that re-exports the needed functions to the students (either through a package or an accompanying file).
#lang htdp/asl also provides read, write and display, but then variables become mutable and functions can be nullary which might not be desired.
@shhyou solution works, and I recommend this approach to students who use ISL+ in my junior-level PL course:
(a) create a module #lang racket (provide whatever you need)
(b) (require "my-favorite-file.rkt")
I would recommend a look at 2htdp/batch-io. It is a teach pack that provides I/O in a way that fits into BSL. I have used it this way in our introductory course.
ASL has become a somewhat unsupported language. I recommend against using it.