Using @warn like @assert?

Short question! Is there a way to conditionally produce a warning without writing the if-end block? It would look like

@warn x < y "you should know that x is less than y"

similar to the way that @assert works.

You can use && or || for this instead:

x < y && @warn "you should know that x is less than y"
2 Likes