# \#\<&undefined-variable ... name: eof-object\>

**URL:** https://community.spritely.institute/t/undefined-variable-name-eof-object/710
**Category:** Hoot: Guile in WASM
**Created:** [May 3, 2025, 5:22pm UTC](https://community.spritely.institute/t/undefined-variable-name-eof-object/710 "2025-05-03T17:22:37Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![liltechdude](https://avatars.discourse-cdn.com/v4/letter/l/8c91f0/32.png) [@liltechdude](https://community.spritely.institute/u/liltechdude)
#### Post date: [May 3, 2025, 5:22pm UTC](https://community.spritely.institute/t/undefined-variable-name-eof-object/710/1 "2025-05-03T17:22:37Z")

</div>

During migration from fibers to goblins in my project I have faced with problem:

```auto
Uncaught exception:
  1. #<&undefined-variable module: #<<module> name: (ice-9 binary-ports) exports: #<hashtable size: 19> defs: #<hashtable size: 600> submodules: #<hashtable size: 0> state: open root: #<<module> name: () exports: #<hashtable size: 0> defs: #<hashtable size: 0> submodules: #<hashtable size: 10> state: detached root: #f>> name: eof-object>
  2. #<&source file: "hoot/errors.scm" line: 95 column: 22>

```

Git Repo: [Prismascape Composition / SkimScripter · GitLab](https://gitlab.com/prismascape-composition/skim-skripter)

As I understand, Hoot does not support variables that exported, but not defined in module. I dont think that so obvious error is not fixed yet, so may be I dont understand something. Please help how I can fix this error.

I use most recent Hoot commit and guile-goblins from guix.

---

<div class="post-metadata">

### Author: ![liltechdude](https://avatars.discourse-cdn.com/v4/letter/l/8c91f0/32.png) [@liltechdude](https://community.spritely.institute/u/liltechdude)
#### Post date: [May 3, 2025, 10:16pm UTC](https://community.spritely.institute/t/undefined-variable-name-eof-object/710/2 "2025-05-03T22:16:33Z")

</div>

This error could be fixed on guile’s or hoot’s (ice-9 binary-ports)?

---

<div class="post-metadata">

### Author: ![dthompson](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.spritely.institute/dthompson/32/95_2.png) [@dthompson](https://community.spritely.institute/u/dthompson)
#### Post date: [May 5, 2025, 12:13pm UTC](https://community.spritely.institute/t/undefined-variable-name-eof-object/710/3 "2025-05-05T12:13:12Z")

</div>

I haven’t seen this particular error before and I’m unsure what action to take based on the details given. What would help me is if you could share a _minimal_ reproducer program that demonstrates the problem. Thanks!

---

<div class="post-metadata">

### Author: ![liltechdude](https://avatars.discourse-cdn.com/v4/letter/l/8c91f0/32.png) [@liltechdude](https://community.spritely.institute/u/liltechdude)
#### Post date: [May 5, 2025, 1:27pm UTC](https://community.spritely.institute/t/undefined-variable-name-eof-object/710/4 "2025-05-05T13:27:02Z")

</div>

This

```scheme
(use-modules (goblins))

```

---

<div class="post-metadata">

### Author: ![dthompson](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.spritely.institute/dthompson/32/95_2.png) [@dthompson](https://community.spritely.institute/u/dthompson)
#### Post date: [May 5, 2025, 1:29pm UTC](https://community.spritely.institute/t/undefined-variable-name-eof-object/710/5 "2025-05-05T13:29:38Z")

</div>

That’s not a complete program. I’m unsure what you are trying to do. We have successfully compiled several programs that uses Goblins at this point.

---

<div class="post-metadata">

### Author: ![liltechdude](https://avatars.discourse-cdn.com/v4/letter/l/8c91f0/32.png) [@liltechdude](https://community.spritely.institute/u/liltechdude)
#### Post date: [May 5, 2025, 1:46pm UTC](https://community.spritely.institute/t/undefined-variable-name-eof-object/710/6 "2025-05-05T13:46:27Z")

</div>

I am just noticed this error produced by -g1 flag 🙂

---

<div class="post-metadata">

### Author: ![dthompson](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.spritely.institute/dthompson/32/95_2.png) [@dthompson](https://community.spritely.institute/u/dthompson)
#### Post date: [May 5, 2025, 1:49pm UTC](https://community.spritely.institute/t/undefined-variable-name-eof-object/710/7 "2025-05-05T13:49:04Z")

</div>

A-ha! Things make more sense now. The `-g` options are not super well supported right now and we haven’t tried to make live hackable Goblins programs with Hoot yet. We have additional work to do to make live hacking work in practice.

---

<div class="post-metadata">

### Author: ![liltechdude](https://avatars.discourse-cdn.com/v4/letter/l/8c91f0/32.png) [@liltechdude](https://community.spritely.institute/u/liltechdude)
#### Post date: [May 5, 2025, 2:06pm UTC](https://community.spritely.institute/t/undefined-variable-name-eof-object/710/8 "2025-05-05T14:06:09Z")

</div>

I have little question: should I always use `call-with-vat` and pass vat as a parameter, or could I somehow wrap all my game inside vat like this:

```auto
(define a-vat (spawn-vat))
(call-with-vat a-vat
 (lambda ()
   (init (reverse script))))

```

---

<div class="post-metadata">

### Author: ![liltechdude](https://avatars.discourse-cdn.com/v4/letter/l/8c91f0/32.png) [@liltechdude](https://community.spritely.institute/u/liltechdude)
#### Post date: [May 5, 2025, 2:09pm UTC](https://community.spritely.institute/t/undefined-variable-name-eof-object/710/9 "2025-05-05T14:09:30Z")

</div>

Because now I get “No current syscaller” error.

---

<div class="post-metadata">

### Author: ![dthompson](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.spritely.institute/dthompson/32/95_2.png) [@dthompson](https://community.spritely.institute/u/dthompson)
#### Post date: [May 5, 2025, 2:15pm UTC](https://community.spritely.institute/t/undefined-variable-name-eof-object/710/10 "2025-05-05T14:15:24Z")

</div>

I don’t know what would be appropriate for your game, but what I can say is that you need to ensure that anything that is using an actor operator (`$`, `<-`, `spawn`, etc.) _must_ be done from within the context of a vat i.e using `call-with-vat` or the `with-vat` syntax sugar.

---

<div class="post-metadata">

### Author: ![liltechdude](https://avatars.discourse-cdn.com/v4/letter/l/8c91f0/32.png) [@liltechdude](https://community.spritely.institute/u/liltechdude)
#### Post date: [May 6, 2025, 10:42am UTC](https://community.spritely.institute/t/undefined-variable-name-eof-object/710/11 "2025-05-06T10:42:36Z")

</div>

Should this code return `(42 . 42)`?

```auto
(define-record-type <foo>
  (make-foo bar)
  foo?
  (bar foo-bar))
(match (list (make-foo 42) (make-foo 42))
  ((($ <foo> bar) ($ <foo> bar*)) (cons bar bar*)))

```

Currently I catch

```auto

Uncaught exception:
  1. #<&assertion>
  2. #<&message message: "value failed to match">
  3. #<&irritants irritants: ((#<<foo> bar: 42> #<<foo> bar: 42>))>
  4. #<&source file: "hoot/errors.scm" line: 95 column: 22>

```

---

<div class="post-metadata">

### Author: ![liltechdude](https://avatars.discourse-cdn.com/v4/letter/l/8c91f0/32.png) [@liltechdude](https://community.spritely.institute/u/liltechdude)
#### Post date: [May 6, 2025, 11:02am UTC](https://community.spritely.institute/t/undefined-variable-name-eof-object/710/12 "2025-05-06T11:02:52Z")

</div>

This is even small example:

```auto
(use-modules
 (goblins)
 (hoot records)
 (ice-9 match))

(define-record-type <foo>
  (make-foo bar)
  foo?
  (bar foo-bar))
(match (make-foo 42)
  (($ <foo> bar) bar))

```

Error reproduces only with goblins

---

<div class="post-metadata">

### Author: ![dthompson](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.spritely.institute/dthompson/32/95_2.png) [@dthompson](https://community.spritely.institute/u/dthompson)
#### Post date: [May 6, 2025, 12:29pm UTC](https://community.spritely.institute/t/undefined-variable-name-eof-object/710/13 "2025-05-06T12:29:01Z")

</div>

This program works for me:

```scheme
(use-modules (srfi srfi-9)
             (ice-9 match))

(define-record-type <foo>
  (make-foo bar)
  foo?
  (bar foo-bar))

(match (list (make-foo 42) (make-foo 42))
  ((($ <foo> bar) ($ <foo> bar*)) (cons bar bar*)))

```

Also, I haven’t had issues matching against records in Goblins programs and Goblins’ own code does this quite a bit.

---

<div class="post-metadata">

### Author: ![liltechdude](https://avatars.discourse-cdn.com/v4/letter/l/8c91f0/32.png) [@liltechdude](https://community.spritely.institute/u/liltechdude)
#### Post date: [May 6, 2025, 12:38pm UTC](https://community.spritely.institute/t/undefined-variable-name-eof-object/710/14 "2025-05-06T12:38:22Z")

</div>

Please try compile program with `(goblins)` lib imported.

I am using goblins from latest guix commit, not from source. Are you too?

---

<div class="post-metadata">

### Author: ![liltechdude](https://avatars.discourse-cdn.com/v4/letter/l/8c91f0/32.png) [@liltechdude](https://community.spritely.institute/u/liltechdude)
#### Post date: [May 6, 2025, 1:18pm UTC](https://community.spritely.institute/t/undefined-variable-name-eof-object/710/15 "2025-05-06T13:18:26Z")

</div>

What kind of info I should provide to register a bug?

---

<div class="post-metadata">

### Author: ![liltechdude](https://avatars.discourse-cdn.com/v4/letter/l/8c91f0/32.png) [@liltechdude](https://community.spritely.institute/u/liltechdude)
#### Post date: [May 6, 2025, 3:57pm UTC](https://community.spritely.institute/t/undefined-variable-name-eof-object/710/16 "2025-05-06T15:57:46Z")

</div>

Yet another question: how to write tests for Hoot project?  
Module (srfi srfi-64) unavailable.

```auto
lil@lil-Zenbook-UX3402VA-UX3402VA:~/Documents/skim-skripter$ make test.wasm
HOOT_LOAD_PATH=/gnu/store/9vm4izgsp0g007d82zgmrvg9zczkxjxj-profile/share/guile-hoot/0.6.0/lib:/gnu/store/9vm4izgsp0g007d82zgmrvg9zczkxjxj-profile/share/guile/3.0 guild compile-wasm -L /gnu/store/q4648183qkl43ky8yp3qqikv63j67dw7-guile-goblins-0.15.1/share/guile/site/3.0 -L modules -L . -o test.wasm test.scm
WARNING: (% %library-group108 srfi srfi-64): `let' imported from both (% %library-group108 srfi srfi-71) and (% %library-group108 guile)
WARNING: (% %library-group108 srfi srfi-64): `let*' imported from both (% %library-group108 srfi srfi-71) and (% %library-group108 guile)
ice-9/psyntax.scm:2663:4: In procedure syntax-violation:
Syntax error:
srfi/srfi-64.scm:1002:37: define-record-type: expected a record type as #:parent in subform &programming-error of (define-record-type &bad-end-name #:parent &programming-error #:extensible? #t (make-bad-end-name begin-name end-name) %exn? (begin-name t-4ea3473da1c326d-165) (end-name t-4ea3473da1c326d-166))
make: *** [Makefile:31: test.wasm] Error 1
lil@lil-Zenbook-UX3402VA-UX3402VA:~/Documents/skim-skripter$ cat test.scm
(use-modules
 (srfi srfi-64))

```

---

<div class="post-metadata">

### Author: ![liltechdude](https://avatars.discourse-cdn.com/v4/letter/l/8c91f0/32.png) [@liltechdude](https://community.spritely.institute/u/liltechdude)
#### Post date: [May 6, 2025, 4:16pm UTC](https://community.spritely.institute/t/undefined-variable-name-eof-object/710/17 "2025-05-06T16:16:14Z")

</div>

I have just reviewed the (test utils) module and get the point, sorry.

---

<div class="post-metadata">

### Author: ![liltechdude](https://avatars.discourse-cdn.com/v4/letter/l/8c91f0/32.png) [@liltechdude](https://community.spritely.institute/u/liltechdude)
#### Post date: [May 6, 2025, 4:42pm UTC](https://community.spritely.institute/t/undefined-variable-name-eof-object/710/18 "2025-05-06T16:42:49Z")

</div>

Also that approach does not working as I expect:

```auto
lil@lil-Zenbook-UX3402VA-UX3402VA:~/Documents/skim-skripter$ make test.wasm
HOOT_LOAD_PATH=/gnu/store/9vm4izgsp0g007d82zgmrvg9zczkxjxj-profile/share/guile-hoot/0.6.0/lib:/gnu/store/9vm4izgsp0g007d82zgmrvg9zczkxjxj-profile/share/guile/3.0:/home/lil/Git/guile-hoot:/home/lil/Git/guile-hoot:/home/lil/Git/guile-hoot/module guild compile-wasm -L /gnu/store/q4648183qkl43ky8yp3qqikv63j67dw7-guile-goblins-0.15.1/share/guile/site/3.0 -L modules -L . -o test.wasm test.scm
ice-9/psyntax.scm:2663:4: In procedure syntax-violation:
Syntax error:
module/hoot/primitives.scm:441:17: define-module: library-group only supports modules with #:declarative? #t in form (define-module (hoot primitives) #:pure #:use-module (hoot frontend) #:use-module ((guile) #:select (canonicalize-path search-path define-syntax-rule syntax-case 

...

(syntax-module-bindings . guile:syntax-module-bindings)) #:declarative? #f)
make: *** [Makefile:32: test.wasm] Error 1
lil@lil-Zenbook-UX3402VA-UX3402VA:~/Documents/skim-skripter$ cat test.scm
(use-modules (test utils))

(test-call "#t" (lambda (a b) (< a b)) 1/2 +inf.0)
(test-call "#f" (lambda (a b) (< a b)) 1/2 -inf.0)
(test-call "#f" (lambda (a b) (< a b)) +nan.0 1/2)

```

---

<div class="post-metadata">

### Author: ![dthompson](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.spritely.institute/dthompson/32/95_2.png) [@dthompson](https://community.spritely.institute/u/dthompson)
#### Post date: [May 6, 2025, 5:09pm UTC](https://community.spritely.institute/t/undefined-variable-name-eof-object/710/19 "2025-05-06T17:09:40Z")

</div>

Guile’s SRFI-64 does not yet work with Hoot, unfortunately. Non-declarative modules do not work in general because they aren’t compatible with Hoot’s whole program compilation approach.

---

<div class="post-metadata">

### Author: ![liltechdude](https://avatars.discourse-cdn.com/v4/letter/l/8c91f0/32.png) [@liltechdude](https://community.spritely.institute/u/liltechdude)
#### Post date: [May 6, 2025, 7:58pm UTC](https://community.spritely.institute/t/undefined-variable-name-eof-object/710/20 "2025-05-06T19:58:53Z")

</div>

Please try `make serve` this bug: [goblins-record-bug/Makefile · main · Prismascape Composition / SkimScripter · GitLab](https://gitlab.com/prismascape-composition/skim-skripter/-/blob/main/goblins-record-bug/Makefile)

I have tried it minimal as possible.

UPD: issue is [#719 - value failed to match with (goblins) lib - spritely/hoot - Codeberg.org](https://codeberg.org/spritely/hoot/issues/719)

[Next page](https://community.spritely.institute/t/undefined-variable-name-eof-object/710.md?page=2)
