error unbound variable w/ srfi-13 and/or module importing

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

error unbound variable w/ srfi-13 and/or module importing

masukomi
I've had a heck of a time getting things to compile statically with
modules. Now, I'm pretty sure I've discovered a related problem that's
either _in_ or triggered by srfi-13

here's my boiled down test harness (a simple hello world)

testing.scm
```
#!/usr/bin/env csi -script

(import hello)
(howdy "world")
```


hello.scm
```
(module hello

  (howdy)
  (import scheme)
  (import chicken.base)
  (import chicken.format)
  (import srfi-13) ; <------ this line is the problem

  (define (howdy who)
    (print (format "howdy ~A~%" who))))
```


compilation:
```
csc -unit hello -cJ hello.scm; csc -link hello -static testing.scm; ./testing
```

error
```
Error: unbound variable:
|\xcf\xfa\xed\xfe\x07\x00\x00\x01\x03\x00\x00\x00\x08\x00\x00\x00|

    Call history:

    <syntax>      (##core#undefined)
    <syntax>      (import scheme chicken.base chicken.syntax)
    <syntax>      (##core#begin (##core#require library scheme#)
(##core#require library chicken.base#) (##core#requir...
    <syntax>      (##core#require library scheme#)
    <syntax>      (##sys#load-library (##core#quote library))
    <syntax>      (##core#quote library)
    <syntax>      (##core#require library chicken.base#)
    <syntax>      (##sys#load-library (##core#quote library))
    <syntax>      (##core#quote library)
    <syntax>      (##core#begin (##core#require expand chicken.syntax#))
    <syntax>      (##core#require expand chicken.syntax#)
    <syntax>      (##sys#load-library (##core#quote expand))
    <syntax>      (##core#quote expand)
    <eval>      (##sys#load-library (##core#quote library))
    <eval>      (##sys#load-library (##core#quote library))
    <eval>      (##sys#load-library (##core#quote expand))    <--

```

If i comment out the `srfi-13` import it runs without error. If I
leave it in, it does not.

Note that running the source file `./testing.scm` works perfectly.
it's ONLY the compiled version that gives the error. I've tried
uninstalling and reinstalling 'srfi-13`. I've also tried importing
`utf8-srfi-13` instead of `srfi-13`. I've tried this in different
files to make sure it wasn't some weird hidden character in one file.

I'm kind-of at a loss as to what's going on here. Any help would be appreciated.

Thanks in advance,
-Kay

_______________________________________________
Chicken-users mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/chicken-users
Reply | Threaded
Open this post in threaded view
|

Re: error unbound variable w/ srfi-13 and/or module importing

felix.winkelmann
> Error: unbound variable:
> |\xcf\xfa\xed\xfe\x07\x00\x00\x01\x03\x00\x00\x00\x08\x00\x00\x00|

This is the magic number of a binary (64-bit Mach-O), so I assume you
are trying this on a Mac. Someone is trying to load a binary as source file,
which indicates that an attempt at binary loading is done and failed,
resulting in another attempt to load the binary as source, resulting in the
start of the file being interpreted as a variable name, which it isn't of course.

Your loading/linking still is not working out. If you have the patience and if
nobody beats me to it, I can give it a try myself and get back to you.

Providing all the right options and tool invocations is indeed a bit of a hassle,
I apologize for that complexity, but flexibility sometimes has a cost...


felix


_______________________________________________
Chicken-users mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/chicken-users
Reply | Threaded
Open this post in threaded view
|

Re: error unbound variable w/ srfi-13 and/or module importing

felix.winkelmann
In reply to this post by masukomi
> compilation:

> csc -unit hello -cJ hello.scm

Add -static here to ensure the srfi-13 dependency is stored in the hello.link file.


felix


_______________________________________________
Chicken-users mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/chicken-users
Reply | Threaded
Open this post in threaded view
|

Re: error unbound variable w/ srfi-13 and/or module importing

masukomi
>> compilation:

>> csc -unit hello -cJ hello.scm

>Add -static here to ensure the srfi-13 dependency is stored in the hello.link file.

Yaay. That did it. Thanks Felix.


- Kay

On Fri, Aug 30, 2019 at 6:45 AM <[hidden email]> wrote:

>
> > compilation:
>
> > csc -unit hello -cJ hello.scm
>
> Add -static here to ensure the srfi-13 dependency is stored in the hello.link file.
>
>
> felix
>

_______________________________________________
Chicken-users mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/chicken-users