Skip to content

@maybe macro #359

@gdkrmr

Description

@gdkrmr

I have a project with longer calculations and have created a macro to automatically save/calculate/reload object. I am using JLD2 for it and there is something similar in YAXArrays.jl.

Do you think it would be possible to create a more general version that can be integrated into FileIO.jl? And: would it make sense to integrate something like this into FileIO.jl?

Syntax is as follows:

@maybe x => "x.jld2" begin
  x = 1
end

If x.jld2 exists, it is loaded and the begin ... end part is skipped, if x.jld2 doesn't exist the expression is run and x is saved in x.jld2.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions