I seem to have this problem, which I can't figure out.
I'm able to load files once use C-c C-k in slime/Emacs. Then I'll go to
the REPL buffer and call all the functions just fine.
Afterwards I'll make some modifications to the buffer and/or add some
functions. C-c C-k again, but the new definitions won't take. I can't
seem to access the modified files, even though it seems to compile just
fine
(notes about unused variables and a warning about
; (DEFUN GET-PROPERTIES (CONTACT-ID))
; Warning: Definition has one arg, but the previous declaration has
two.
)
but anyways none of the new definitions or modifications take within
the REPL.
This seems to happen over time, when I start emacs up, everything seems
fine. but after a while my loads just stop working. Could it be that
because of the warning slime isn't loading the file?
I'm not sure what to do, but it sure does make development a pain...
any help appreciated. Thanx.
Also,
I tried to perform a manual (load file) at the REPL and this is what I
get
Attempt to modify the locked package COMMON-LISP, by
redefining function GET-PROPERTIES
[Condition of type LISP::PACKAGE-LOCKED-ERROR]
Restarts:
0: [CONTINUE] Ignore the lock and continue
1: [UNLOCK-PACKAGE] Disable package's definition-lock, then continue
2: [UNLOCK-ALL] Disable all package locks, then continue
3: [CONTINUE] Return NIL from load of "EmailSurveys.lisp".
4: [ABORT-REQUEST] Abort handling SLIME request.
5: [ABORT] Return to Top-Level.
Okay,
so I commented out the function get-properties from my file, and now
C-c C-k works to load the file, but my question now is why doesn't it
tell me that it didn't load the file? And does this mean I can't define
a function named get-properties, even though its in my own package?
"sickfaichezi" <············@gmail.com> writes:
> Okay,
>
> And does this mean I can't define a function named get-properties,
> even though its in my own package?
You can but you need to define your package so that it has its own
GET-PROPERTIES symbol, for instance:
(defpackage :my-package
(:use :common-lisp)
(:shadow :get-properties))
The :use clause gives you access to all the exported symbols of the
COMMON-LISP package and the :shadow clause causes a new symbol with
the name "GET-PROPERTIES" to be created and added to the package so it
will shadow the symbol named "GET-PROPERTIES" that would otherwise be
inherited from the COMMON-LISP package.
-Peter
--
Peter Seibel * ·····@gigamonkeys.com
Gigamonkeys Consulting * http://www.gigamonkeys.com/
Practical Common Lisp * http://www.gigamonkeys.com/book/
The wierd thing is I don't export that symbol; so why should I have to
shadow it?
Heres my defpackage statement:
defpackage :mypackage
(:use :common-lisp :cl-ppcre :clsql :net.post-office)
(:export :send-mails
:process-bounces))
GET-PROPERTIES is a standard function defined in the COMMON-LISP
package. Since you're using that package, CL-USER has a symbol named
GET-PROPERTIES from the CL package. So when you define your own
function with that name, a conflict arises.
You can either choose a different name, or, as Peter recommended, just
shadow that symbol in MYPACKAGE.
hth,
Bill
"sickfaichezi" <············@gmail.com> writes:
> The wierd thing is I don't export that symbol; so why should I have
> to shadow it?
Exporting and shadowing are completely different. Exporting a symbol
has to do with other packages that :use your package gain access to
the symbol (or whether you can refer to the symbol with a single-colon
qualified name like foo:bar). Shadowing controls where the reader
finds the symbol when it reads a name. When you :use :common-lisp
then, absent any shadowing, when the reader reads the name
"GET-PROPERTIES" with your package as *PACKAGE* it find the symbol
COMMON-LISP:GET-PROPERTIES because it's exported from COMMON-LISP and
your package use COMMON-LISP. Since you want the reader to find a
different symbol, you need to explicitly say so. Shadowing is how you
say so.
-Peter
--
Peter Seibel * ·····@gigamonkeys.com
Gigamonkeys Consulting * http://www.gigamonkeys.com/
Practical Common Lisp * http://www.gigamonkeys.com/book/