-
Notifications
You must be signed in to change notification settings - Fork 46
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
Use same function name with Julia's standard library TOML.jl #145
Comments
Not sure I agree with all of these - the semantics of This package predates a lot of other conventions, and in general I'm in favor of unifying the API with what is now standard. Would probably want to have a patch release that adds deprecation warnings, and then a separate release where things are changed. |
I propose:
Users should be aware of that a YAML file represents 0 or more YAML documents in order that they do not cause possible misuse and errors. This makes it clear for users that the current behavior that |
This sounds ok to me. We could even make |
The deprecation code will be: # YAML.jl v0.5
@deprecate load parsefirst
@deprecate load_all parse
@deprecate load_file parsefirstfile
@deprecate load_all_file parsefile |
YAML spec uses the words load and dump for converting a YAML to a native data and the reverse process. |
If the deprecation is completed, I think it may be good to prepare |
Julia base exports the name |
Thinking about it again, the semantics of |
It's the most important interface, it will be good to gather broad opinions. |
On the whole I think it's better to follow YAML terminology than trying to match some other markup language implementation, regardless whether that's an stdlib. Even if YAML allows multiple documents in a file or stream, single-document files are by far the more common case and should be easy to use. The proposal to change So well, I think the current names for the reading functions are basically fine, and better than the alternatives. |
YAML.jl uses different function names but we should use same function names with TOML.jl (and JSON.jl) because most people are accustomed to its names. Also we should not use underscores for function names because Julia don't use them in conventions.
load
,load_all
→parse
,tryparse
load_file
,load_all_file
→parsefile
,tryparsefile
write
→print
I have no idea about how to treat
all
.The text was updated successfully, but these errors were encountered: