Skip to content

Improve macro hygeine #8

@jakobnissen

Description

@jakobnissen

First, thank you for a great package.

I noticed that the macros exported by PrecompileTools, unlike those of SnoopPrecompile, requires the package to have access to the name PrecompileTools. This means that the following code will fail:

using PrecompileTools: @setup_workload, @compile_workload

@setup_workload let
    ...
    @compile_workload let
        ...
    end
end

It is generally preferred to explicitly import names from packages instead of using a broad using Package statement, since that can cause newly exported names in non-breaking releases to lead to a name being unresolvable, thus breaking code.

So, I propose either:

  • If possible, change PrecompileTools such that it's not necessary for the user to need to be able to resolve the name Precompile (it's probably just some macro hygeine stuff)
  • If not possible, amend the documentation to be clear that you need to do using PrecompileTools: PrecompileTools, @setup_workload, @compile_workload

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions