Skip to content

Breaking change -- improve the if/unless macros

Compare
Choose a tag to compare
@wyhaines wyhaines released this 05 Apr 22:49
· 21 commits to main since this release

Originally, the macros took code as text. I don't know why I did that. One can take code via block syntax, and I don't think there should be any problems with that since the evaluation is in the context of the macro, so even blocks that reference things that they can't know about, out of context, will be fine because the code doesn't actually get compiled or interpreted out of context.

So:

if_defined("Foo") do
  puts "#{Foo} is defined"
end

Will work.