This is a follow up to my previous question. It seems, unfortunately, that Chicken Scheme, by default, doesn't support complex numbers, but rather offers a numbers
egg that can be installed.
I have installed this egg, via chicken-install numbers
, and I can load it in an interpreted environment. I can do this by calling use
; either manually in the REPL, or by running my .scm
file as a script through csi
.
For example, this script works perfectly:
(use numbers)
(begin
(display 3+3i)
(newline)
)
when run with:
csi -s main.scm
But when I compile this exact same snippet with csc
(even without any addtional flags), I get the same runtime error that I would if I didn't load it (e.g. an unbound variable.) It seems as if in a compiled environment use
doesn't cut the mustard.
Two other things to note, is that, per the documentation, I tried other importing functions such as require-extension
, require-library
, etc., but none make an difference. The other is that if I change the name of the module to something other than numbers
, say numberss
, it fails to compile, complaining that it can't load the extension, so obviously it is at least detecting that the numbers
library is installed.
Could anyone please explain, preferably through a short working example how to use an egg in a compiled environment? Thanks in advance! :)