Skip to content

Commit

Permalink
Formatting fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Tortar authored Sep 30, 2024
1 parent 6be608e commit fe051af
Showing 1 changed file with 17 additions and 16 deletions.
33 changes: 17 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,22 +28,23 @@ julia> @hybrid struct S{Y} <: AbstractS{Y}
which in this case it generates:

```julia
abstract type AbstractS_Mut{Y} <: AbstractS{Y} end
abstract type AbstractS_Immut{Y} <: AbstractS{Y} end

mutable struct S_Mut{Y} <: AbstractS_Mut{Y}
const x::Int
y::Y
z::Float64
end

struct S_Immut{Y} <: AbstractS_Immut{Y}
x::Int
y::Y
z::Float64
end

const S = Union{S_Immut{Y}, S_Mut{Y}} where Y
julia> abstract type AbstractS_Mut{Y} <: AbstractS{Y} end

julia> abstract type AbstractS_Immut{Y} <: AbstractS{Y} end

julia> mutable struct S_Mut{Y} <: AbstractS_Mut{Y}
const x::Int
y::Y
z::Float64
end

julia> struct S_Immut{Y} <: AbstractS_Immut{Y}
x::Int
y::Y
z::Float64
end

julia> const S = Union{S_Immut{Y}, S_Mut{Y}} where Y
```

It is then possible to create instances of the specified version with
Expand Down

0 comments on commit fe051af

Please sign in to comment.