[Bese-devel] darcs patch: Add :fiveam to *features*

Marco Baringer mb at bese.it
Fri Aug 12 14:34:08 UTC 2005


Alan Shields <Alan-Shields at omrf.ouhsc.edu> writes:

> Thu Aug 11 16:20:32 CDT 2005  Alan Shields <Alan-Shields at omrf.ouhsc.edu>
>   * Add :fiveam to *features*
>   I've found that I prefer to add testing code in my other code, but I dislike
>   adding :fiveam to my package requirements list.

i am hesitant to modify *features*, it's not really supposed to be
used for this (afaict). you could do this:

(defun :fiveam ()
  (if (find-package :it.bese.fiveam)
      '(and)
      '(or)))

...

#+#.(fiveam)
(test
  ...)

if you want to avoid giving a keyword a function value you'll have to
fully qualify the function name:

#+#.(my-package:fiveam)

is this Good Enough(TM)? (since you want the code to run without
fiveam loaded you will need to define the fiveam function for every
package which uses fiveam (or any other test suite for that
matter)). if this becomes common i could distribute a 'boot strap'
file for fiveam which contains:

(in-package :common-lisp-user)

(defpackage :it.bese.fiveam
  (:nicknames :5am)
  (:export :?))

(defun 5am:? ()
  (if (find-package :it.bese.fiveam)
      '(and)
      '(or)))

and you'd litter your code with:

#.#+(5am:?)
(test ...)

you'd then include this file in all your projects. loading fiveam will
replace the package definition but until then the reader will be
happy. on second thought, i think this idea sucks.

-- 
-Marco
Ring the bells that still can ring.
Forget the perfect offering.
There is a crack in everything.
That's how the light gets in.
	-Leonard Cohen



More information about the bese-devel mailing list