Instead of checking if it is defined, have you thought about using defoverridable so people could override the definition in case they choose to without a need to a before_compile callback?