From: OMouse
Subject: Compiling a file with a package included
Date: 
Message-ID: <1136754272.237106.4300@g43g2000cwa.googlegroups.com>
This is my code:
---------------------------------------------
(load "http.fas")
(use-package 'http)

(defun param(str)
  (http::http-query-parameter str))
---------------------------------------------

It gives me an error message when I compile using clisp -c. It says
HTTP package doesn't exist. What am I doing wrong?
Thanks for any help,
Rudolf

From: Rainer Joswig
Subject: Re: Compiling a file with a package included
Date: 
Message-ID: <joswig-9C12A3.10440409012006@news-europe.giganews.com>
In article <······················@g43g2000cwa.googlegroups.com>,
 "OMouse" <······@gmail.com> wrote:

> This is my code:
> ---------------------------------------------
> (load "http.fas")
> (use-package 'http)
> 
> (defun param(str)
>   (http::http-query-parameter str))
> ---------------------------------------------
> 
> It gives me an error message when I compile using clisp -c. It says
> HTTP package doesn't exist. What am I doing wrong?
> Thanks for any help,
> Rudolf

a) You have to load that file before you can compile it.

b) You have to load 'http.fas' before you can compile this file.


Explanation:

If you compile a file the instructions don't get executed, but
compiled. So the compiler won't execute (load "http.fas"),
but compile it into the compiled file. During compilation
it later sees the HTTP package, which does not exist.

This can be controlled with EVAL-WHEN.


Btw., why are you compiling Lisp code with clisp -c ? is there
any specific reason to it? Usually I would start clisp
and compile file is (COMPILE-FILE "filename.lisp") from
the toplevel.

-- 
http://lispm.dyndns.org/
From: OMouse
Subject: Re: Compiling a file with a package included
Date: 
Message-ID: <1136869647.897444.123400@g49g2000cwa.googlegroups.com>
Thanks.