[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
case using other equality-testing predicates
If case used equalp or had a keyword :test with the usual meaning,
I could use case instead of redefining it..
I include the explanation below for those who might choose to try to
satisfy my perceived need by another programming construct..
In an application I had hoped to put in a package, I used
a construction analogous to
(in-package 'commandpackage)
.....
(case com ;; com is a command, an atom read in by Lisp reader
(p <some stuff>)
((1 first) <more stuff>)
(cos <yet more stuff>)
... etc)
Now when you read in the atom p, it is not the same as the item
in the case table, which is commandpackage::p. Exporting and then
shadowing-importing p, first, cos, .. is not a good idea, (in general), but
specifically because the symbols first, cos, etc would cover up the
functions of the same name.
What it seems I need is another macro in the case-family that
tests using equalp rather than eql, so I can use strings.. e.g.
(string-case (string com)
("p" <some stuff>)
(("1" "first") <more stuff>)
... etc..