problems with chapter 7

149 views
Skip to first unread message

xiaoma

unread,
Nov 9, 2010, 4:41:52 AM11/9/10
to Land of Lisp
Hi, there. I've been working through LoL for the past couple of days
and it's been a great read! It's a bit dense and it's harder to get
through than I'd expected, but I've managed okay up to ch7.

Now, I'm stuck, though. When inputting
(graph->png "wizard.dot" *nodes* *edges*)
into clisp I get the following error:
*** - Win32 error 2 (ERROR_FILE_NOT_FOUND): The system cannot find the
file specified.

This error is surprising since it should be a new file. My output
looks okay for all the smaller functions up to graph->dot, and I've
tried copying and pasting the code from http://landoflisp.com/graph-util.lisp
for each function I've used, but the results are the same.

Any idea what could be causing the error? Also is there any easier
way to import code into clisp than copy and pasting?

Thanks

Brisance

unread,
Nov 9, 2010, 5:51:35 AM11/9/10
to Land of Lisp
It seems that CLISP was unable to find the "wizard.dot" file. Was it
created? If it was, are you in the right path? Make sure you also ran
the node->dot and edges->dot functions.

You can do all your text editing in your favorite text editor such
emacs and vim. Ater saving the file, just run "clisp -repl <filename>"
with the correct path, of course.

xiaoma

unread,
Nov 9, 2010, 6:47:05 AM11/9/10
to Land of Lisp


On Nov 9, 6:51 pm, Brisance <cru...@gmail.com> wrote:
> It seems that CLISP was unable to find the "wizard.dot" file. Was it
> created? If it was, are you in the right path? Make sure you also ran
> the node->dot and edges->dot functions.

I thought it was supposed to *create* a wizard.dot file. Otherwise,
what's the point of writing a program at all instead of entering the
graph information manually?

> You can do all your text editing in your favorite text editor such
> emacs and vim. Ater saving the file, just run "clisp -repl <filename>"
> with the correct path, of course.

Thanks, this is going to speed up debugging a ton!

Conrad

unread,
Nov 9, 2010, 7:50:32 AM11/9/10
to Land of Lisp
yes, it should create the dot file- I will check this evening and see
what is going on.

xiaoma

unread,
Nov 10, 2010, 2:18:42 PM11/10/10
to Land of Lisp
I've figured out a little bit more about what's going on. Some of the
problem might be with paths. I put everything into a c:\lisp
directory. Then after loading the file into clisp with
(load "c:/lisp/graph-util.lisp)

and ignoring the warnings about redefining functions, and running
(graph->png "c:/lisp/wizard" *nodes* *edges*)

it properly generated a wizard.dot file! I still got the same error
as before though... I guess that happened when trying to create the
png file with neato. Neato is in my path, so I think the problem is
in the dot->png function

...
(ext:shell (concatenate 'string "dot -Tpng -O "fname)))

I can guess what ext:shell does, but since the string "neato" doesn't
show up anywhere in the code listing, I don't see how it could be
getting called by the lisp program.

Conrad

unread,
Nov 14, 2010, 2:49:49 PM11/14/10
to Land of Lisp
Hi xiaoma- The program "dot" should be in you path as well. The
program "dot" and "neato" generate two different types of layouts (see
http://www.graphviz.org/)

I would also try running "clisp" directly from the directory
containing the lisp files.

Please let me know if these ideas help.

-Conrad

xiaoma

unread,
Dec 1, 2010, 4:49:18 AM12/1/10
to Land of Lisp

> I would also try running "clisp" directly from the directory
> containing the lisp files.
>
> Please let me know if these ideas help.
>
Yes! That did the trick. Thanks.

pstnotpd

unread,
Dec 1, 2010, 6:01:41 AM12/1/10
to Land of Lisp
I ran into the same problem on SBCL on linux.
Managed to solve it by adding the default directory to the
concatenated string which calls dot in the function dot->png

...
(shell (concatenate 'string "dot -Tpng -O " (directory-namestring
*DEFAULT-PATHNAME-DEFAULTS*) fname ".dot")))
...
this should pick up the dot file from where it put it in the first
place.

greg r

unread,
Dec 8, 2010, 10:00:10 PM12/8/10
to Land of Lisp
(ext:shell (concatenate 'string "dot -Tpng -O "fname)))

Is this the "system call" which is mentioned on page 115?

Greg

De-hua Yin

unread,
Aug 13, 2012, 11:57:31 AM8/13/12
to land-o...@googlegroups.com
   The problem is the same with me. I ran it at lispbox-0.7-clisp-2.37.
    But, next day!  I try it again, it's OK!
    Restart your computer, then try it again!  maybe you can get it.
 
It's a bit dense and it's harder to get
through than I'd expected, but I've managed okay up to ch7.

Reply all
Reply to author
Forward
0 new messages