Chapter 7 - Running graphutils code in Clozure CL on Mountain Lion

76 views
Skip to first unread message

FordPrefect

unread,
Feb 5, 2013, 11:03:49 PM2/5/13
to land-o...@googlegroups.com
Hi there,

I've been working through chapter 7 and wanted to try creating the graph. I grabbed the source from the site and have tried running it like so:

(graph->png *wizard-nodes* *wizard-edges*)

I get this error in return from the listener:

Error: Unbound variable: *WIZARD-NODES*

I see the *wizard-nodes* defined as a global variable at the beginning of the file. Any idea how I can run the sample?

Thanks.

Kevin Lindsey

unread,
Feb 6, 2013, 10:31:06 AM2/6/13
to land-o...@googlegroups.com
Hi FordPerfect,

I'm a Lisp newbie here, but I did the following in clisp on OS X and it worked for me:
  1. Downloaded graph-util.lisp
  2. Started clisp
  3. (load "graph-util")
  4. graph->png wasn't in that file, so I typed it in at the REPL
  5. (graph->png "wizard.dot" *wizard-nodes* *wizard-edges*)
FWIW, I have seen some strangeness with long REPL sessions where I was typing in the code from the book. Later changes wouldn't seem to work. I found quitting clisp, restarting clisp, and then loading my lisp file oftentimes resolved those issue. Maybe that's what's happening here for you.

HTH,
Kevin

Message has been deleted

FordPrefect

unread,
Feb 8, 2013, 1:42:43 PM2/8/13
to land-o...@googlegroups.com
Thanks.

Reply all
Reply to author
Forward
0 new messages