From: Raymond T. <toy...@gm...> - 2024-10-30 15:10:09
|
On Mon, Oct 28, 2024 at 5:46 PM Eduardo Ochs <edu...@gm...> wrote: > Hi all, > > in another thread I was discussing LispTree, that at this moment has > three files - two ".lisp" files and one ".mac" file. Link: > > http://anggtwu.net/lisptree.html > > The functions in the file "lisptree.lisp" can be tested in SBCL > without loading Maxima, but the file "lisptree-middle.lisp" needs > Maxima. > > I think that debugging the parts in Lisp can become easier if I merge > the two Lisp files into a single one, with a structure like this, > > (defpackage :lisptree (:use :common-lisp)) > (in-package :lisptree) > ;; ... > #+maxima > (progn > (in-package :maxima) > ;; ... > ) > > that only runs the second part if we are "inside Maxima"... but as far > as I know Maxima doesn't define a "feature", so the "#+maxima" would > have to replaced by something else that checks if > We perhaps should add this feature? But here's something I learned long ago (can't remember where or from whom) and is used in the code generated by f2cl: #+#.(cl:if (cl:find-package '#:f2cl) '(and) '(or)) Change '#:f2cl to '#:maxima or just "MAXIMA" for your use case. But maybe this isn't what you want? Maybe you want to know if the current package is "MAXIMA"? Then something like (cl:if (eq cl:*package (cl:find-package "MAXIMA")) '(and) '(or)) |