Let me understand the PACKAGE mechanism




Maybe some of the Lisp meisters are going to help me:

I have two files:

grammar2dot.lisp:
======================================================
(in-package :cl-user)

(defpackage :org.ileriseviye.linear2tree
(:use :common-lisp)
(:export :produce-tree-output))

.... some parameters, functions, etc

(defun produce-tree-output ()
... function body ...)
======================================================


grammar-web.lisp
======================================================
(defpackage :org.ileriseviye.grammar-web
(:use
:common-lisp
:net.aserve
:net.html.generator
:org.ileriseviye.linear2tree))

(in-package :org.ileriseviye.grammar-web)

;; let's see if we can run the function
(produce-tree-output)

.... some functions related to web, etc. ...
=====================================================


As you see my purpose is to define two packages and
use a function called "produce-tree-output" in grammar-web.lisp
(defining the package :org.ileriseviye.grammar-web) which is
defined in grammar-web.lisp (defining the package
:org.ileriseviye.grammar-web).

However when I hit C-c k in my Emacs+SLIME environment
when I'm editing the file grammar-web.lisp it says:

The function PRODUCE-TREE-OUTPUT is undefined.
[Condition of type UNDEFINED-FUNCTION]

Bear in mind that the both files are in same directories.

I also receive the same error when I try to run a function
(defined in grammar-web.lisp) which also uses the produce-tree-output:

"got error The function ORG.ILERISEVIYE.LINEAR2TREE:PRODUCE-TREE-OUTPUT
is undefined."

How can I reach one function defined in another file?

What am I doing wrong? Something wrong with parameters
passed to (in-package ...)?

Thanks in advance.

Happy hacking,

--
Emre Sevinc

eMBA Software Developer Actively engaged in:
http:www.bilgi.edu.tr http://ileriseviye.org
http://www.bilgi.edu.tr http://fazlamesai.net
Cognitive Science Student http://cazci.com
http://www.cogsci.boun.edu.tr
.