Closed mcandre closed 13 years ago
There are two problems here: 1) adding specific lisp files to the asdf load path doesn't work, you have to supply the directory of the package (or rather, where the system definition can be found); and 2) LOAD is not ASDF aware.
I would try something like this (note, I don't know what implementation you are using, so this might not be exactly right, but it should illustrate the general procedure):
(push "~/path/to/cl-mechanize" custom:load-paths)
(asdf:operate 'asdf:load-op :cl-mechanize)
(in-package :cl-mechanize-user)
Does that help?
When I run that code, the result is:
*\ - component "cl-mechanize" not found
By the way, I'm using cl-mechanize 0.0 / Quicklisp 2010121400 / CLISP 2.49 / MacPorts 1.9.2 / Mac OS X 10.6.6.
Hm, that seems to me like a path problem. Are you sure that your implementation performs path expansion (I don't think platform specific path expansions are required by the spec, but it probably doesn't forbid it either)?
Without sh-like path expansion, using "~" as a shorthand for $HOME will not work, rather you must use the proceure USER-HOMEDIR-PATHNAME to get $HOME (or, use your vendor's GETENV, if that exists).
I can't verify it right now, but I think something like this should do the trick:
(push (merge-pathnames "relative/path/to/cl-mechanize")
(user-homedir-pathname) custom:load-paths)
(asdf:operate 'asdf:load-op :cl-mechanize)
...
Also, take care of stale .fas and .lib files, and other things that could interfere with the proper functioning of asdf.
In case it still doesn't work, you might try also LOAD-ing the system definition manually, like so (after setting up the asdf path correctly):
(load "/absolute/path/to/cl-mechanize/cl-mechanize.asd)
Doing this would "force" the definition into the REPL environment (but this is a work-around, at best -- if it even does anything useful for you).
If all else fails, please give the exact commands you've entered (along with non-sensitive parts of your clisprc.lisp file), and also the value of the CUSTOM:LOAD-PATHS binding, and I'll try to figure out if there are any CLISP-specific issues I have to take into account (I use SBCL, but cross-vendor compatibility is a very important goal).
In any case, I have to warn you that spending a lot of energy trying to get this to work is probably not worth it (depending on what you want to use it for) -- cl-mechanize is just a thin wrapper around drakma that tries to provide a modicum of extra convenience when doing certain tasks from the REPL.
The tilde expansion doesn't seem to be the problem.
(push "/Users/andrew/cl-mechanize" custom:load-paths)
; Raises *\ - component "cl-mechanize" not found
(asdf:operate 'asdf:load-op :cl-mechanize)
(in-package :cl-mechanize-user)
I think that CLISP and SBCL handle loading differently.
Ok, I've checked the CLISP manual. custom:*load-paths*
only applies to LOAD, not ASDF. Further, CLISP does not ship a custom version of ASDF that takes custom:*load-paths
into account (indeed, CLISP doesn't ship with ASDF at all: in your case it's provided by Quicklisp).
See [http://www.gnu.org/software/clisp/impnotes/loadfile.html]() for more information on how this works (if, for some reason, you want to hack up a solution that would let you combine load and asdf).
In other words, you have to use asdf:*central-registry*
, not custom:*load-paths*
:
(push #p"/path/to/cl-mechanize/" asdf:*central-registry*)
...
This should work regardless of CL implementation (and I've verified that it does for CLISP).
Hope this works. If not, I don't really have any idea what's going on.
Yes!
It happens that cxml-stp fails to compile, so I posted on Quicklisp.
https://github.com/quicklisp/quicklisp-projects/issues/issue/113
Cool. I know there have been some issues with getting the deps to build. I'd be interested in knowing if/when you get it all to work. Right now, I don't know what versions of the libraries worked for me when I wrote the mechanize package :(
The standard require asdf / asdf:operate / in-packge :cl-mechanize-user doesn't work for me.
I put cl-mechanize into ~, so the following should work:
(push "~/cl-mechanize/cl-mechanize.lisp" custom:load-paths) (load "cl-mechanize") (use-package :cl-mechanize)
However, I get this message:
*\ - SYSTEM::%FIND-PACKAGE: There is no package with name "CL-MECHANIZE"
All I can do is change cl-mechanize.lisp to cl-mechanize.asd, in which case I can't properly load the code from cl-mechanize.lisp. I suggest adding the following:
(defpackage :cl-mechanize (:export :browser :form :link :page :fetch :submit :follow :back :reload :_user-agent :_cookie-jar-dir* :accept-cookies-p* :cookie-lifetime-policy) (:use :cl))
Just before:
(in-package :cl-mechanize)