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

Add objects to represent YAML versions. #224

Closed
wants to merge 1 commit into from

Conversation

Paalon
Copy link
Contributor

@Paalon Paalon commented Jun 20, 2024

Add objects to represent YAML versions for traits. For #198, #223.

src/versions.jl Outdated Show resolved Hide resolved
src/versions.jl Outdated Show resolved Hide resolved
src/versions.jl Outdated Show resolved Hide resolved
@Paalon
Copy link
Contributor Author

Paalon commented Jun 21, 2024

I'll squash commits and comments in one.

Here we use abstract type & subtyping because it's common traits pattern
in Julia.
We do not need to export these objects because we can use strings for
versions in user-facing functions like:

```julia

function load(str::AbstractString; version::YAMLVersion)
    # ...
end

function load(str::AbstractString; version::AbstractString)
    version == "1.1" ? load(str, version=YAMLV1_1()) :
    version == "1.2" ? load(str, version=YAMLV1_2()) :
    throw(ErrorException())
end

load(str, version="1.1")
```
@Paalon
Copy link
Contributor Author

Paalon commented Jun 21, 2024

Now squashed.

@kescobo
Copy link
Collaborator

kescobo commented Jun 21, 2024

OH, I think I did this out of order...

@kescobo
Copy link
Collaborator

kescobo commented Jun 21, 2024

Gonna pause until monday, let me know if something has changed in the mean time

@Paalon
Copy link
Contributor Author

Paalon commented Jun 21, 2024

The conflicts are inevitable. Not your fault.

@Paalon
Copy link
Contributor Author

Paalon commented Jun 21, 2024

The commits in this PR are merged.

@Paalon Paalon closed this Jun 21, 2024
@Paalon Paalon deleted the yamlversion branch June 30, 2024 03:56
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

Successfully merging this pull request may close these issues.

3 participants