Skip to content

Commit

Permalink
Add hex for Chr types in v0.6
Browse files Browse the repository at this point in the history
  • Loading branch information
ScottPJones committed Oct 21, 2018
1 parent 32aac58 commit d06fd00
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/compat.jl
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,6 @@ in(x::Chr, y::Chr) = x == y
+(x::Integer, y::Chr) = y + x
show(io::IO, cp::Chr) = show(io, Char(cp))
print(io::IO, cp::Chr) = print(io, Char(cp))

Base.hex(chr::C) where {C<:Chr} = hex(codepoint(chr))
Base.hex(chr::C, pad) where {C<:Chr} = hex(codepoint(chr), pad)

0 comments on commit d06fd00

Please sign in to comment.