[Larceny-users] error loading srfi-19 from r5 repl
Felix Klock
felixluser at pnkfx.org
Tue Jan 6 15:11:43 EST 2009
Marco-
On Jan 6, 2009, at 2:48 PM, Marco Maggi wrote:
> 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.
My memory is that one needs to load or require srfi-0 in some manner
before loading or requiring srfi-19.
> (require 'srfi-0)
#t
> (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
More information about the Larceny-users
mailing list