aartaka / graven-image

Portability library for better interaction and debugging of a running Common Lisp image through text REPL.
BSD 3-Clause "New" or "Revised" License
19 stars 3 forks source link

Bad Feature Flag Usage in ASD #28

Closed Shinmera closed 1 year ago

Shinmera commented 1 year ago

https://github.com/aartaka/graven-image/blob/cc47baf21d639dadc7b4226a8f1d3498b206c094/graven-image.asd#L14C1-L14C1

Note that you should not use feature flags anywhere within an ASD as it hinders introspection through ASDF. Further, sb-introspect is not a system, but rather a module, so it should be depended on differently. The correct way to do this is to use (:feature :sbcl (:require :sb-introspect)).

Fwiw for feature-conditionalising components within the system, you should use the syntax (:file "foo" :if-feature :bla)

aartaka commented 1 year ago

Thanks for mentioning it—I was unaware of this syntax! I totally agree about ASDF introspection, it's important.

Fwiw for feature-conditionalising components within the system, you should use the syntax (:file "foo" :if-feature :bla)

Yes, I know at least this feature :sweat_smile: But that requires files, which is not always compatible with Graven Image approaches (ugly long feature-conditionalized macros.

It won't hurt rewriting them as separate toplevel forms based on implementation, but that's a topic for another time: #29.