2

2.rkt has the following definition:

(provide plus)

(define (plus a b)
  (+ a b))

and 1.rkt has:

(require "2.rkt")

(plus 3 4)

Both are in "Beginning Student Language" level (so no #lang line required) and are in the same directory.

This leads to a provide: this function is not defined error in 2.rkt.

Adding (require racket/base) in 2.rkt fixes this but then I can do things like (cons 1 2) which shouldn't be allowed in BSL.

How can I use plus in 1.rkt in BSL?

Atharva Shukla
  • 1,944
  • 5
  • 18
  • 1
    See [_BSL (How to Design Programs): how to import code from a separate file into definitions area?_](https://stackoverflow.com/questions/52653570/bsl-how-to-design-programs-how-to-import-code-from-a-separate-file-into-defin) – Alex Knauth Jul 02 '19 at 15:09
  • Thank you, that was exactly what I was looking for – Atharva Shukla Jul 03 '19 at 04:45

0 Answers0