Skip to content

Commit cfc6041

Browse files
committed
Implement show for ArrayLikeBlock
1 parent a8014e6 commit cfc6041

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/varnamedtuple.jl

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,18 @@ struct ArrayLikeBlock{T,I}
6767
end
6868
end
6969

70+
function Base.show(io::IO, alb::ArrayLikeBlock)
71+
# Note the distinction: The raw strings that form part of the structure of the print
72+
# out are `print`ed, whereas the keys and values are `show`n. The latter ensures
73+
# that strings are quoted, Symbols are prefixed with :, etc.
74+
print(io, "ArrayLikeBlock(")
75+
show(io, alb.block)
76+
print(io, ", ")
77+
show(io, alb.inds)
78+
print(io, ")")
79+
return nothing
80+
end
81+
7082
_blocktype(::Type{ArrayLikeBlock{T}}) where {T} = T
7183

7284
"""

0 commit comments

Comments
 (0)