Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@maybe macro #359

Open
gdkrmr opened this issue May 6, 2022 · 0 comments
Open

@maybe macro #359

gdkrmr opened this issue May 6, 2022 · 0 comments

Comments

@gdkrmr
Copy link

gdkrmr commented May 6, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant