# Operator (from racket/base) not known

**URL:** <https://racket.discourse.group/t/operator-from-racket-base-not-known/3733>\
**Category:** Questions & Answers\
**Created:** [May 8, 2025, 1:12pm UTC](https://racket.discourse.group/t/operator-from-racket-base-not-known/3733 "2025-05-08T13:12:21Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![damien\_mattei](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/damien_mattei/32/2706_2.png) [@damien\_mattei](https://racket.discourse.group/u/damien_mattei)\
**Post date:** [May 8, 2025, 1:12pm UTC](https://racket.discourse.group/t/operator-from-racket-base-not-known/3733/1 "2025-05-08T13:12:21Z")

</div>

Hi,

i'm writing a parser to evaluate super-scripted expression (not sure it is a good idea in real life but i like the display) used in exponentiation expressions, here is a working example :

```scheme
Welcome to DrRacket, version 8.14 [cs].
Language: reader SRFI-105, with debugging; memory limit: 8192 MB.
SRFI-105 Curly Infix parser for Racket Scheme and R6RS by Damien MATTEI
(based on code from David A. Wheeler and Alan Manuel K. Gloria.)

Parsed curly infix code result = 

(module repl racket (provide (all-defined-out)) (require Scheme+))
Scheme+ v10.0 by Damien Mattei

> {3 ²}
9

```

the above expression is well transformed (with syntax transformers) in `(**3 2)` but if i try : `{3 ⁻²}` which require to transform the above expression in : `(** 3 (- 2))`  
(note: i could produce `(** 3 -2)` which would work but for prefix general expressions it is not always possible to work like this)  
then with `(** 3 (- 2))` i have this error:

```scheme
$nfx$ op1 e1 : parsed-args=.#<syntax (** 3 (- 2))>
. ../superscript-parser.rkt:207:24: -: unbound identifier;
 also, no #%top syntax transformer is bound
  context...:
  other binding...:
  context at layer 1...: in: -

```

the offending line of code is this one:

```scheme
(return (cons #'-
		      (state-0-syntax-analysis nxt)))

```

that would return what would became after syntax transforming `(- 2)`

Writing this post i find a solution :

```scheme
(return (cons '-
		      (state-0-syntax-analysis nxt)))

```

which give the good result:

```scheme
{3 ⁻²}
1/9

```

i post anyway the message because i'm curious of what solution to avoid the original error. I found a solution with `(quote -)` but i hoped to have one with `(syntax -)` working too.  
Generally adding something like `(require (for-syntax racket/base))` is enought to remove the error, but not in this case.

```scheme
(define n 3)
{3 ²*⁽ⁿ⁻⁴⁾}
1/9

{3 ²·⁽ⁿ⁻⁴⁾}
1/9

```

Damien

---

<div class="post-metadata">

**Author:** ![Eutro](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/eutro/32/2275_2.png) [@Eutro](https://racket.discourse.group/u/Eutro)\
**Post date:** [May 12, 2025, 6:25pm UTC](https://racket.discourse.group/t/operator-from-racket-base-not-known/3733/2 "2025-05-12T18:25:45Z")

</div>

Without seeing the code it's difficult to tell the issue, but is it possible that you need `(require (for-template racket/base))` instead? This would be a problem if your unbound `#'-` is at phase 0 of the enclosing module, where `racket/base` isn't already available at the right phase.

```scheme
#lang racket/base
; Call the phase at which this module runs "phase 0"

(module bad-reference racket/base ; <- only contains phase 1 bindings
  ;; uncomment below to fix:
  ;;(require (for-template racket/base))
  (provide negated)
  (define (negated x) #`(- #,x)))
; ^ this is bound only at phase 1, because
; v 'bad-reference is required at phase 1
(require (for-syntax racket/base 'bad-reference))

(define-syntax (negate stx)
  (syntax-case stx {}
    [(_ x) (negated #'x)]))
; ^ negated runs in phase 1,
; v but the expansion gets used in phase 0
(negate 5)
;; -: unbound identifier;
;; also, no #%app syntax transformer is bound
;; at: -
;; in: (- 5)

```

---

<div class="post-metadata">

**Author:** ![damien\_mattei](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/damien_mattei/32/2706_2.png) [@damien\_mattei](https://racket.discourse.group/u/damien_mattei)\
**Post date:** [May 12, 2025, 10:04pm UTC](https://racket.discourse.group/t/operator-from-racket-base-not-known/3733/3 "2025-05-12T22:04:39Z")

</div>

> [@Eutro](#):
>
> `(require (for-template racket/base))`

yes, your solution worked.
