[ANN] DispatchDoctor.jl 🩺 – offers you a prescription for type stability

Awesome :slight_smile:


By the way, does anybody have a workaround for using @stable directly on the top-level block of a Julia module?

I would like to do:

module MyPackage
@stable begin  # Wrap entire package
  
# pkg code...

# with some reexports:
using Reexport: @reexport
@reexport using MySubmodule: A, B, C
  
end
end

However, for this, it says @reexport is undefined. I looked more into this and it seems macros aren’t allowed to have their definition in a regular block:

begin
    macro m(ex); ex; end
    @m 1
end

This gives the same error. (e.g., Macros not imported within blocks)

So, to this, my question is: how can I apply @stable to the top-level block of a module, from within the module itself?

Basically I want for

@stable begin

end

to get “merged” into the same block it sits in, rather than creating a new block.