Skip to content

Use YAML version traits for is_b_char#225

Closed
Paalon wants to merge 2 commits into
JuliaData:masterfrom
Paalon:b-char
Closed

Use YAML version traits for is_b_char#225
Paalon wants to merge 2 commits into
JuliaData:masterfrom
Paalon:b-char

Conversation

@Paalon
Copy link
Copy Markdown
Contributor

@Paalon Paalon commented Jun 20, 2024

Depends on #224. Use YAML version traits.

Paalon added 2 commits June 21, 2024 15:14
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

The commits in this PR are merged in #204.

@Paalon Paalon closed this Jun 21, 2024
@Paalon Paalon deleted the b-char branch June 30, 2024 03:57
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.

2 participants