How to set a property in the current module

If I call setproperty!(anymodule, sym, val) it gives an error cannot assign variables in other modules. Does that suggest I can assign variables in the current module? But if so, how? This setproperty!(NameOfCurrentModule, sym, val) still gives the same error.

And maybe the same question: is there some way to reference the current module in a general way (not by specific name)?

I think this is what you want?

@eval $sym = $val

And @__MODULE__ is the current module.