Hi,

while doing some more testing on the sdl egg, I came across this
peculiarity.  The sdl egg defines a sdl-csi program, that works as
a repl and initialises sdl first. The script is really short and
looks like this:

(import chicken scheme foreign)

(declare
 (foreign-declare "#include <SDL.h>\n")
 (run-time-macros)
)
(foreign-code "SDL_Init(SDL_INIT_EVERYTHING);")

(use posix)
(use sdl)

(handle-exceptions
    exn
    exn
  (load (string-append (or (getenv "HOME") ".") "/.csirc")))

(for-each load (cdr (argv)))

(repl)

(sdl-quit)
(exit 0)

Now, consider a file like this, called foo.scm:

(use apropos)
(print "SDL things I know about: ~A~%" (apropos 'sdl))


Now when I load it with 'sdl-csi foo.scm'  I get an error like this:
Error: unbound variable: apropos

If I change 'use' to 'require-extension' it works as expected.

As I found out the '(use)' statement is an er-transformer that
obviously cannot be invoked in (repl).  I don't see the csi program
in core doing something else. So why does (use) work there?

Thanks,

Christian


_______________________________________________
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users

Reply via email to