Re: Weird -keyword-style prefix behaviour with modules
Thanks a lot! On Tue, Feb 17, 2026 at 7:10 PM Kon Lovett wrote: > > > > On Feb 17, 2026, at 7:42 AM, Alexey Egorov via Chicken-users > wrote: > > Oh, that's why. Thank you very much, now I see. > > Also, I found an issue with my original example: I forgot to add -uses > module to main.o compilation. When I added it it also started to work. > So I failed to properly link my compiled code, and instead import > tried to load the source file. > > > I should remember that -:d flag. By the way, how does one learn about > it? Are there any other flags? > Csc and Chicken man pages don't seem to mention it. > > > https://wiki.call-cc.org/man/5/Using%20the%20compiler#runtime-options > > > On Tue, Feb 17, 2026 at 4:55 PM Peter Bex wrote: > > > On Tue, Feb 17, 2026 at 02:57:43PM +0300, Alexey Egorov via Chicken-users > wrote: > > ./test > > Result: > Error: Module `module' has unresolved identifiers > > > Try running it with -:d, like so: > > ./test -:d > > Then you'll notice it emits the following line: > > ; loading ./module.scm ... > > The reason is that it will try to load module.so at runtime, and failing > that, it will fall back to trying to load module.scm. And the default > prefix style applies there. To change that you'd have to set the > keyword-style parameter yourself at runtime. > > If you want to compile statically, you will have to avoid loading the > module dynamically. > > Compile it like this: > > csc -static -o test main.o module.o > > and then it'll work. > > Note that you only need to use -K prefix to compile module.scm, as the > prefix style only applies to the *reader*. > > Cheers, > Peter > > >
Re: Weird -keyword-style prefix behaviour with modules
> On Feb 17, 2026, at 7:42 AM, Alexey Egorov via Chicken-users > wrote: > > Oh, that's why. Thank you very much, now I see. > > Also, I found an issue with my original example: I forgot to add -uses > module to main.o compilation. When I added it it also started to work. > So I failed to properly link my compiled code, and instead import > tried to load the source file. > > I should remember that -:d flag. By the way, how does one learn about > it? Are there any other flags? > Csc and Chicken man pages don't seem to mention it. https://wiki.call-cc.org/man/5/Using%20the%20compiler#runtime-options > > On Tue, Feb 17, 2026 at 4:55 PM Peter Bex wrote: >> >> On Tue, Feb 17, 2026 at 02:57:43PM +0300, Alexey Egorov via Chicken-users >> wrote: >>> ./test >>> >>> Result: >>> Error: Module `module' has unresolved identifiers >> >> Try running it with -:d, like so: >> >> ./test -:d >> >> Then you'll notice it emits the following line: >> >> ; loading ./module.scm ... >> >> The reason is that it will try to load module.so at runtime, and failing >> that, it will fall back to trying to load module.scm. And the default >> prefix style applies there. To change that you'd have to set the >> keyword-style parameter yourself at runtime. >> >> If you want to compile statically, you will have to avoid loading the >> module dynamically. >> >> Compile it like this: >> >> csc -static -o test main.o module.o >> >> and then it'll work. >> >> Note that you only need to use -K prefix to compile module.scm, as the >> prefix style only applies to the *reader*. >> >> Cheers, >> Peter >
Re: Weird -keyword-style prefix behaviour with modules
Oh, that's why. Thank you very much, now I see. Also, I found an issue with my original example: I forgot to add -uses module to main.o compilation. When I added it it also started to work. So I failed to properly link my compiled code, and instead import tried to load the source file. I should remember that -:d flag. By the way, how does one learn about it? Are there any other flags? Csc and Chicken man pages don't seem to mention it. On Tue, Feb 17, 2026 at 4:55 PM Peter Bex wrote: > > On Tue, Feb 17, 2026 at 02:57:43PM +0300, Alexey Egorov via Chicken-users > wrote: > > ./test > > > > Result: > > Error: Module `module' has unresolved identifiers > > Try running it with -:d, like so: > > ./test -:d > > Then you'll notice it emits the following line: > > ; loading ./module.scm ... > > The reason is that it will try to load module.so at runtime, and failing > that, it will fall back to trying to load module.scm. And the default > prefix style applies there. To change that you'd have to set the > keyword-style parameter yourself at runtime. > > If you want to compile statically, you will have to avoid loading the > module dynamically. > > Compile it like this: > > csc -static -o test main.o module.o > > and then it'll work. > > Note that you only need to use -K prefix to compile module.scm, as the > prefix style only applies to the *reader*. > > Cheers, > Peter
Re: Weird -keyword-style prefix behaviour with modules
On Tue, Feb 17, 2026 at 02:57:43PM +0300, Alexey Egorov via Chicken-users wrote: > ./test > > Result: > Error: Module `module' has unresolved identifiers Try running it with -:d, like so: ./test -:d Then you'll notice it emits the following line: ; loading ./module.scm ... The reason is that it will try to load module.so at runtime, and failing that, it will fall back to trying to load module.scm. And the default prefix style applies there. To change that you'd have to set the keyword-style parameter yourself at runtime. If you want to compile statically, you will have to avoid loading the module dynamically. Compile it like this: csc -static -o test main.o module.o and then it'll work. Note that you only need to use -K prefix to compile module.scm, as the prefix style only applies to the *reader*. Cheers, Peter
