Skip to content

Add objects to represent YAML versions.#224

Closed
Paalon wants to merge 1 commit into
JuliaData:masterfrom
Paalon:yamlversion
Closed

Add objects to represent YAML versions.#224
Paalon wants to merge 1 commit into
JuliaData:masterfrom
Paalon:yamlversion

Conversation

@Paalon
Copy link
Copy Markdown
Contributor

@Paalon Paalon commented Jun 20, 2024

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

Comment thread src/versions.jl Outdated
Comment thread src/versions.jl Outdated
Comment thread src/versions.jl Outdated
@Paalon
Copy link
Copy Markdown
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
Copy Markdown
Contributor Author

Paalon commented Jun 21, 2024

Now squashed.

@kescobo
Copy link
Copy Markdown
Member

kescobo commented Jun 21, 2024

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

@kescobo
Copy link
Copy Markdown
Member

kescobo commented Jun 21, 2024

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

@Paalon
Copy link
Copy Markdown
Contributor Author

Paalon commented Jun 21, 2024

The conflicts are inevitable. Not your fault.

@Paalon
Copy link
Copy Markdown
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