Checking whether classes have been evaluated
Another snippet I used for testing.
Bug #1165 requests the ability to check for whether a class exists, but we've already got that:
class yay {
notify { "This is a test": }
}
class other {
if defined(Class[yay]) {
notify { "Defined works just fine": }
}
}
include yay, other
Prints:
notice: This is a test notice: Defined works just fine
Works for me. :)