This is the mail archive of the kawa@sourceware.org mailing list for the Kawa project.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
Other format: | [Raw text] |
I recently found myself wanting to conditionalize some code on the presence of a Java class. At first, I tried to see if I could have a module call (provide 'some-feature) only when this class was found, but then I realized it would be much simpler to modify the feature testing in IfFeature.java to recognize class names as a last resort. This has proven quite handy for me, letting me do something like:
(cond-expand (com.example.AClass ;; AClass is found in classpath, safe to use (define-simple-class MySubclass (com.example.AClass) ...)) (else (error "AClass not found.")))
It seems unlikely for some unrelated feature's name to exactly match a fully-qualified class name, so I think this patch is pretty safe.
-- Jamison Hope The PTR Group www.theptrgroup.com
Attachment:
IfFeature.patch
Description: Binary data
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |