Discussion:
[Larceny-users] error loading srfi-19 from r5 repl
Marco Maggi
2009-01-06 19:48:38 UTC
Permalink
Sorry if this turns out to be my bad understanting
of the documentation. At the REPL I get:

$ larceny
...
(require 'srfi-19)
Error: Undefined global variable "srfi-6"

and I notice that "(require 'srfi-6)" loads the
SRFI with no errors.
--
Marco Maggi

"Now feel the funk blast!"
Rage Against the Machine - "Calm like a bomb"
Felix Klock
2009-01-06 20:11:43 UTC
Permalink
Marco-
Post by Marco Maggi
Sorry if this turns out to be my bad understanting
$ larceny
...
(require 'srfi-19)
Error: Undefined global variable "srfi-6"
and I notice that "(require 'srfi-6)" loads the
SRFI with no errors.
My memory is that one needs to load or require srfi-0 in some manner
before loading or requiring srfi-19.
Post by Marco Maggi
(require 'srfi-0)
#t
Post by Marco Maggi
(require 'srfi-19)
#t

Every time this problem has bitten me, I've had to look at the source
code to figure out why its happening.

I believe the reason that srfi-19 does not do (require 'srfi-0) itself
[[even though it *does* do (require 'time) itself]] is that srfi-0
provides syntax definitions, and so adding that require invocation
would only solve the problem for dynamic loading of the source text,
but not for compiling the file ahead of time.

Having said that, the current situation does not seem terribly
desirable to me. I'll let Will decide whether he'd prefer to fix this
by documenting the requirement, or adding a macro to srfi-6's source
code that statically checks that srfi-0 has been loaded at expansion
time, or some other solution to avoid the confusing behavior that you
described, Marco.

-Felix

Loading...