[plt-scheme] Re: Linking Minikanren for The Reasoned Schemer in Mzscheme

From: Benjamin L.Russell (DekuDekuplex at Yahoo.com)
Date: Wed Oct 15 04:43:35 EDT 2008

On Tue, 14 Oct 2008 18:50:47 -0700 (PDT), n n
<thule124 at yahoo.com> wrote:

>Hello --
>I think this is not a smart question, and I apologise; but it seems for me all the hard problems are either undecidable or involve linking...

There is no need to apologize.  One of the purposes of a mailing list
it to provide a discussion forum for solving problems of this nature.

>I recently discovered The Reasoned Schemer, and have been trying to follow it in mzscheme.  I am quite new to the PLT implementation, and I seem to be having trouble getting the REPL to process the minikanren code, and then mine subsequently.  At the moment, I am doing something like this:
>(using the Windows brand operating system from Microsoft Corporation)
>C:\download\ss> "c:\program files\plt\mzscheme.exe"
>;;;(mzscheme turn on)
>>(enter! "minikanren.ss")        ;;; minikanren code in the local directory, copied from the world wide web 
>;;; now I have no trouble running unification style queries like (run #f (q) (== q 5))
>>(enter! "reasonedschemer.ss")   ;;;my implementations of the book's definitions
>;;; I get this error message: 
>;;; reasonedschemer.ss:6:28: compile: unbound variable in module in: fresh
>Apparently my reasonedschemer.ss file is not seeing the definitions available to me on the REPL.  I have tried various combinations of (require ...) but am not sure if my local paths are causing problems with this.  I have also tried simply appending my own definitions to minikanren.ss, but this also seemed to cause problems whose nature were quite obscure to me.  I have been able to implement up to Ch. 4 from the REPL, but I would like to use the Notepad brand integrated development environment instead, if possible.  Is there a preferred way to load minikanren once and and then be able to use (enter! ...) to update my own definitions from the file as I change them?  If I recall, this was roughly how I did the other Lisper series books.

Would it be possible to request you to provide the code in your
following files, so that somebody on this list can reproduce the

1) minikanren.ss
2) reasonedschemer.ss

>PS: I apologise if this may produce a double posting; embarrassingly I cannot even claim to be bad with the world wide web, since this is just email..

Again, there is no need to apologize; this did not result in any
double posting.  Double postings occur occasionally in practice, and
in any event, are no reason for one to "claim to be bad with ...
email"; many people who use e-mail frequently occasionally make double
postings as well.

-- Benjamin L. Russell

P.S. Incidentally, the "Notepad brand integrated development
environment" that you referred to is actually a text editor, and not a
complete integrated development environment.

In order to facilitate your editing and debugging experience, since
you already seem relatively familiar with the MzScheme core virtual
machine for the PLT Scheme implementation of the Scheme programming
language, you may wish to investigate either the DrScheme programming
environment at the Web page linked to by the
http://download.plt-scheme.org/drscheme/ URL, or the GNU Emacs
extensible, customizable text editor at the Web page linked to by the
http://www.gnu.org/software/emacs/ URL.

In addition, if you decide to use the GNU Emacs editor, please keep in
mind the Quack editor mode at the Web page linked to by the
http://www.neilvandyke.org/quack/ URL.

Further, when setting up the GNU Emacs editor for use with the PLT
Scheme implementation of the Scheme programming language, you may find
useful the "Setting up Emacs for use with PLT Scheme on Windows or Mac
OS X" Web-based textual instruction page available at the Web page
linked to by the http://bc.tech.coop/scheme/scheme-emacs.htm URL.

Posted on the users mailing list.