Skip to content

@with macro clashes with Base.@with in Julia 1.11+ #364

Open
@tkemmer

Description

@tkemmer

Julia 1.11 is the first version to export Base.@with:

help?> @with
  @with vars... expr

  Macro version of with(f, vars...) but with expr instead of f function. This is similar to using with with a do block, but avoids creating a closure.

This causes a name conflict with DataFramesMeta.@with (i.e., error when the latter used in a module). MWE:

julia> module Foo
    using DataFrames, DataFramesMeta

    const df = DataFrame(a = [1, 2, 3])
    print() = @with df println.(:a)
end
WARNING: both DataFramesMeta and Base export "@with"; uses of it in module Foo must be qualified
ERROR: LoadError: UndefVarError: `@with` not defined
in expression starting at REPL[14]:6

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