# Help: I can't get contract-in to work!

**URL:** <https://racket.discourse.group/t/help-i-cant-get-contract-in-to-work/3041>\
**Category:** Questions & Answers\
**Created:** [July 19, 2024, 5:37am UTC](https://racket.discourse.group/t/help-i-cant-get-contract-in-to-work/3041 "2024-07-19T05:37:57Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Greg\_Davidson](https://avatars.discourse-cdn.com/v4/letter/g/5f8ce5/32.png) [@Greg\_Davidson](https://racket.discourse.group/u/Greg_Davidson)\
**Post date:** [July 19, 2024, 5:37am UTC](https://racket.discourse.group/t/help-i-cant-get-contract-in-to-work/3041/1 "2024-07-19T05:37:57Z")

</div>

I'm trying to bring in some functions from a relative file using **contract-in** with Racket v8.13 [cs]. Nothing I've tried seems to work. The doc says

```scheme
([contract-in] require-spec contract-in-item ...)
where require-spec is as in require and
contract-in-item = [id contract-expr]

```

yet nothing I've tried works. For example

```scheme
(contract-in
  "sprites-worlds-game.rkt"
  [make-universe (-> universe?)])

```

gives the error message

```scheme
contract-in: illegal use of syntax
  value at phase 1: #<rt> in: (contract-in "sprites-worlds-game.rkt" (make-universe (-> universe?)))

```

**How can I use contract-in correctly?**

---

<div class="post-metadata">

**Author:** ![bakgatviooldoos](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/bakgatviooldoos/32/1381_2.png) [@bakgatviooldoos](https://racket.discourse.group/u/bakgatviooldoos)\
**Post date:** [July 19, 2024, 6:24am UTC](https://racket.discourse.group/t/help-i-cant-get-contract-in-to-work/3041/2 "2024-07-19T06:24:46Z")

</div>

Hi, @Greg_Davidson.

I think you might be [missing a `require`](https://docs.racket-lang.org/reference/attaching-contracts-to-values.html#%28form._%28%28lib._racket%2Fcontract%2Fbase..rkt%29._contract-in%29%29), if I am not mistaken?

```scheme
(require (contract-in
          "sprites-worlds-game.rkt"
          [make-universe (-> universe?)]))

```

Note the bit in the docs about "via `require`".

I hope that helps.

---

<div class="post-metadata">

**Author:** ![Greg\_Davidson](https://avatars.discourse-cdn.com/v4/letter/g/5f8ce5/32.png) [@Greg\_Davidson](https://racket.discourse.group/u/Greg_Davidson)\
**Post date:** [July 20, 2024, 7:03pm UTC](https://racket.discourse.group/t/help-i-cant-get-contract-in-to-work/3041/3 "2024-07-20T19:03:56Z")

</div>

Thank you, I can make that work for my needs. I'll file a bug report on the documentation (as soon as I figure out how) as I've now found multiple inaccuracies there! 😉
