# I can't seem to understand the output of the following code:

**URL:** <https://racket.discourse.group/t/i-cant-seem-to-understand-the-output-of-the-following-code/3886>\
**Category:** General\
**Created:** [August 4, 2025, 10:15am UTC](https://racket.discourse.group/t/i-cant-seem-to-understand-the-output-of-the-following-code/3886 "2025-08-04T10:15:31Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rugged](https://avatars.discourse-cdn.com/v4/letter/r/5f8ce5/32.png) [@Rugged](https://racket.discourse.group/u/Rugged)\
**Post date:** [August 4, 2025, 10:15am UTC](https://racket.discourse.group/t/i-cant-seem-to-understand-the-output-of-the-following-code/3886/1 "2025-08-04T10:15:31Z")

</div>

```scheme
#lang racket

;; Use '() instead of the 'empty' alias
(define board #("X" "0" empty empty))

(for/vector ([val board]
             #:when (empty? val))
  val) ; this returns '#()

```

I would expect it to return '#(empty empty)

---

<div class="post-metadata">

**Author:** ![Rugged](https://avatars.discourse-cdn.com/v4/letter/r/5f8ce5/32.png) [@Rugged](https://racket.discourse.group/u/Rugged)\
**Post date:** [August 4, 2025, 10:19am UTC](https://racket.discourse.group/t/i-cant-seem-to-understand-the-output-of-the-following-code/3886/2 "2025-08-04T10:19:57Z")

</div>

```scheme
(for/vector ([val board]
             #:when (eq? val 'empty))
  val)

```

this works, why? I am a bit confused

---

<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:** [August 4, 2025, 10:29am UTC](https://racket.discourse.group/t/i-cant-seem-to-understand-the-output-of-the-following-code/3886/3 "2025-08-04T10:29:15Z")

</div>

this works:

```scheme
(define board (vector "X" "0" empty empty))
(for/vector ((val board) #:when (empty? val)) val)
'#(() ())

```

---

<div class="post-metadata">

**Author:** ![shawnw](https://yyz2.discourse-cdn.com/free1/user_avatar/racket.discourse.group/shawnw/32/1031_2.png) [@shawnw](https://racket.discourse.group/u/shawnw)\
**Post date:** [August 4, 2025, 10:50am UTC](https://racket.discourse.group/t/i-cant-seem-to-understand-the-output-of-the-following-code/3886/4 "2025-08-04T10:50:52Z")

</div>

> [@Rugged](#):
>
> ```scheme
> ;; Use '() instead of the 'empty' alias
> (define board #("X" "0" empty empty))
> 
> ```

Literal vectors are self-quoting, so you have a vector with two strings, and two symbols (Both `'empty`). If you want to use `empty` so it gets treated as a variable and its contents used, you have to use `vector`:

```scheme
(define board (vector "X" "O" empty empty))

;;; this works too:
;;; (define board #("X" "0" () ()))

;;; or quasiquote shenanigans
;;; (define board `#("X" "0" ,empty ,empty))

```
