I'm trying to resurrect an old (1999 or earlier) project written in Scheme (PLT-Scheme, using the mzscheme
interpreter (?) commandline tool). To make the matters worse, I don't know Scheme, or Lisp (in fact, I want to learn, but that's another story).
I have the source code of the project at:
github.com/akavel/sherman
Now, when running the code, it bails out with an error message like below:
Sherman runtime version 0.5
Hosted on MzScheme version 52, Copyright (c) 1995-98 PLT (Matthew Flatt)
reference to undefined identifier: list->block
(I've tried PLT-Scheme versions 52, 53, 103, 103p1. Earlier versions don't allow mzscheme -L
option, which is referenced in the sherman.bat
script used in the project. Later versions also have some more serious problems with the code or options.)
The difficulty is, that from what I see, list->block
actually is defined - see: collects/sherman/BLOCK.SS
line 48. So, what is wrong?
To run the code, I perform the following steps:
c:\PLT
).c:\sherman\collects\sherman
directory with contents to: c:\PLT\collects\sherman
(where c:\sherman
contains the contents of the github repository).cmd.exe
, then cd c:\sherman
.set PATH=c:\PLT;%PATH%
sherman.bat run trivial.s
(require-library "runtime.ss" "sherman") (parameterize ((current-namespace sherman-namespace)) (load "trivial.s")) (current-namespace sherman-namespace)
Could you help me solve the problem?
EDIT 2: SOLVED!
To whom it may concern, I've added a fully fledged "How to use this project" instruction on the project page, detailing the solution to the problem thanks to soegaard's help.
In short:
copy trivial.s trivial.rs
rem (the above is workaround for problems with 'r2s.exe < trivial.r > trivial.rs')
sherman.bat compile trivial.rs
sherman.bat run trivial.zo
rem (or: sherman.bat run trivial.ss)
Not an answer, but a few notes too big for a comment.
1. Sanity Check
The error message says list->block
is undefined.
Make sure that the code in block.ss
is run, by
inserting (display "block.ss is loaded!")
in block.ss
just to make sure, the code is run.
2. Random Thoughts
The file blocks.ss
begins with:
(require-library "functios.ss")
(require-library "synrule.ss")
(require-library "stream.ss" "sherman")
The file "sherman/stream.ss" is in the repository, but where is "synrule.ss" and "functios.ss" ?
Ah... This code is old! Here is a description of
how require-library
worked. It lists functios.ss
and synrule.ss
as part of MzLib.
http://www.informatik.uni-kiel.de/~scheme/doc/mzscheme/node158.htm
Let's check out how require-library
worked:
When require-library is used to load a file, the library name and the resulting value(s) are recored in a table associated with the current namespace. If require-library is evaluated for a library that is already registered in the current namespace's load table, then the library is not loaded again; the result(s) recorded in the load table is returned, instead.
So when the code in block.ss
is run, the names are stored in a namespace. If the current namespace is the wrong one, when the code in block.ss
is evaluated, it would explain you error message of list->block
being undefined.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With