Open
Description
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
Labels
No labels