<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#003333">
<br>
<div class="moz-cite-prefix">On 10/30/2013 04:06 PM, Zach Beane
wrote:<br>
</div>
<blockquote cite="mid:8761sefjet.fsf@zpobx.site.sys" type="cite"><br>
<pre wrap="">
That code should go in test2.asd:
;;;; test2.asd
(asdf:defsystem #:test2
:depends-on (#:cl-ppcre)
:serial t
:components ((:file "package")
(:file "test2")))
Then you have package.lisp:
(defpackage #:test2
(:use #:cl)
(:export #:my-great-test))
Then you can put this in test2.lisp:
;;;; test2.lisp
(in-package #:test2)
(defun my-great-test ()
(describe 'cl-ppcre:regex-apropos))
Put those files somewhere ASDF knows about. I like to put it in
something like ~/quicklisp/local-projects/test2/, so you can, from the
repl, use this:
(ql:quickload "test2")
Then you should be able to evaluate, in the REPL:
(test2:my-great-test)
Many people automate the process of setting up project directories,
system files, and initial sources. My automation of it is the
quickproject utility; there are several others.
I don't recommend putting calls to code-loading functions directly in
source files, most of the time.
Zach</pre>
</blockquote>
Thank you, Zach. <br>
<br>
But what about the very common (for me, at least) case where I want
to experiment around with some code that is not intended to go in a
package. It's experimental code - say I have some data I'm want to
read and process. I'm in the data directory when I start lisp. Its
not in an ASDF path and don't really want to modify that search tree
everytime I write a one-off piece of code. <br>
<br>
I can quickload cl-fad, say, cl-ppcre, and all kinds of packages
and write code in the REPL and it works fine. But I don't want to
have to retype all this code everytime I revisit the data. I want to
be able to type it in a local file, say, test.lisp" and C-c C-c on
the lines again tomorrow if I want to run them again. Or maybe C-c,
k the whole file and run it that way. So in this context how can I
load packages as lines in this file without losing the ability to
navigate within their functions? Are you saying that I either have
to enter each package load and subsequent commands in the REPL or
build a formal package with an .asd and package file, and tell ASD
about it? <br>
<br>
I've been writing code like this for years - it's only recently that
it started behaving differently. <br>
<br>
Regards,<br>
--Jeff<br>
<br>
<br>
</body>
</html>