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

@Paalon Paalon commented Jun 20, 2024

Copy link
Copy Markdown
Contributor

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

Paalon commented Jun 21, 2024

Copy link
Copy Markdown
Contributor Author

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

Paalon commented Jun 21, 2024

Copy link
Copy Markdown
Contributor Author

Now squashed.

@kescobo

kescobo commented Jun 21, 2024

Copy link
Copy Markdown
Member

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

@kescobo

kescobo commented Jun 21, 2024

Copy link
Copy Markdown
Member

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

@Paalon

Paalon commented Jun 21, 2024

Copy link
Copy Markdown
Contributor Author

The conflicts are inevitable. Not your fault.

@Paalon

Paalon commented Jun 21, 2024

Copy link
Copy Markdown
Contributor Author

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