-
Notifications
You must be signed in to change notification settings - Fork 82
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
Proposal: FileIO.save keyword argument syntax (FileIO.kwsave ?) #324
Comments
I like this idea, I think we can deprecate the single-positional-argument method in favor of a manually written one In the meantime, adding a non-exported symbol |
This is very heavily used in queryverse. The entire file IO story revolves around this pattern, so I would be very, very opposed to this :) |
I recognize it's useful functionality, and we should keep it. But it's undocumented behavior of |
I've added a new syntax to JLD2 and I'm wondering if this could be made compatible with FileIO.
Current example using
FileIO
:This is clearly very verbose, particularly when variable names are long.
However, this could be made much cleaner if we use keyword argument syntax instead
What's great about this, is that we use standard julia syntax and let the parser do the work of extracting
variable names. Until now this was only possible using the
@save
and@load
macros from e.g. BSON, JLD, or JLD2but these macros introduce odd (and limited) syntax and keep being misunderstood by newcomers.
I'm aware that kwarg stuff is typically not type-stable but this is rarely important when IO is involved.
The problem:
There already is a single-positional-argument method for
FileIO.save
that returns an anonymous functionto be used with pipes.
What do you think?
Is this interface idea useful enough to add it to
FileIO
in some way?The text was updated successfully, but these errors were encountered: