# Require in htdp/bsl

**URL:** https://racket.discourse.group/t/require-in-htdp-bsl/3988
**Category:** Questions & Answers
**Tags:** teaching
**Created:** [October 28, 2025, 12:59pm UTC](https://racket.discourse.group/t/require-in-htdp-bsl/3988 "2025-10-28T12:59:04Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![ToddOBryan](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/toddobryan/32/1962_2.png) [@ToddOBryan](https://racket.discourse.group/u/ToddOBryan)
#### Post date: [October 28, 2025, 12:59pm UTC](https://racket.discourse.group/t/require-in-htdp-bsl/3988/1 "2025-10-28T12:59:05Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![soegaard](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/soegaard/32/19_2.png) [@soegaard](https://racket.discourse.group/u/soegaard)
#### Post date: [October 28, 2025, 1:05pm UTC](https://racket.discourse.group/t/require-in-htdp-bsl/3988/2 "2025-10-28T13:05:01Z")

</div>

You could follow the lead of the "convert" TeachPack.

> **[1.3 Converting Temperatures: "convert.rkt"](https://docs.racket-lang.org/teachpack/convert.html)**

---

<div class="post-metadata">

### Author: ![shhyou](https://avatars.discourse-cdn.com/v4/letter/s/ccd318/32.png) [@shhyou](https://racket.discourse.group/u/shhyou)
#### Post date: [October 28, 2025, 1:05pm UTC](https://racket.discourse.group/t/require-in-htdp-bsl/3988/3 "2025-10-28T13:05:57Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![EmEf](https://avatars.discourse-cdn.com/v4/letter/e/53a042/32.png) [@EmEf](https://racket.discourse.group/u/EmEf)
#### Post date: [October 28, 2025, 2:19pm UTC](https://racket.discourse.group/t/require-in-htdp-bsl/3988/4 "2025-10-28T14:19:32Z")

</div>

1. @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")

1. 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.

2. ASL has become a somewhat unsupported language. I recommend against using it.

---

<div class="post-metadata">

### Author: ![ToddOBryan](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/toddobryan/32/1962_2.png) [@ToddOBryan](https://racket.discourse.group/u/ToddOBryan)
#### Post date: [October 28, 2025, 4:28pm UTC](https://racket.discourse.group/t/require-in-htdp-bsl/3988/5 "2025-10-28T16:28:24Z")

</div>

Thanks for the suggestions. I'll take a look.
