Skip to content

stamp(path) do … end has no method — the do-block form the documentation teaches #17

Description

@sotashimozono

The documentation shows:

stamp("figures/energy_sweep.provenance.toml") do
    sweep(model; βs = 0.05:0.05:2.0)
end

do passes the function as the first argument, so that is stamp(f, path). The methods are

stamp(::AbstractString, ::Record)
stamp(::AbstractString, ::Any)

so the documented call raises MethodError: no method matching stamp(::var"#…", ::String).

record(f; …) already takes the function first, so the two verbs disagree on argument order as well.

Fix

stamp(f::Function, path::AbstractString) = stamp(path, f)

Typed ::Function so stamp(path, value) stays unambiguous against stamp(::AbstractString, ::Any).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

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