Closed nickrobinson251 closed 2 years ago
This is part of my motivation for StaticStrings.jl:
julia> using StaticStrings
julia> StaticString((0x61, 0x62, 0x63))
"abc"
julia> StaticString((0x61, 0x62, 0x63, 0x64))
"abcd"
julia> StaticString(Tuple((0x61, 0x62, 0x63)))
"abc"
julia> StaticString(Tuple((0x61, 0x62, 0x63, 0x64)))
"abcd"
Was there a reason not to support this and instead require a user to give
pos
andlen
arguments explicitly?I don't particularly have a use-case beyond having expected this to work having it tried it when developing locally...
Since someone can write
I thought it might make sense to be able to write
I think
length(buf)
is probably the correct default, e.g. to get(rather than e.g. just consuming as much of the buffer as would fit in the requested type)