Skip to content

Commit d9f4a44

Browse files
authored
don't use repr in show (#530)
1 parent f5192c7 commit d9f4a44

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/tangent_types/thunks.jl

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,11 @@ end
194194

195195
@inline unthunk(x::Thunk) = x.f()
196196

197-
Base.show(io::IO, x::Thunk) = print(io, "Thunk($(repr(x.f)))")
197+
function Base.show(io::IO, x::Thunk)
198+
print(io, "Thunk(")
199+
show(io, x.f)
200+
print(io, ")")
201+
end
198202

199203
Base.convert(::Type{<:Thunk}, a::AbstractZero) = @thunk(a)
200204

@@ -218,5 +222,9 @@ end
218222
unthunk(x::InplaceableThunk) = unthunk(x.val)
219223

220224
function Base.show(io::IO, x::InplaceableThunk)
221-
return print(io, "InplaceableThunk($(repr(x.val)), $(repr(x.add!)))")
225+
print(io, "InplaceableThunk(")
226+
show(io, x.add!)
227+
print(io, ", ")
228+
show(io, x.val)
229+
print(io, ")")
222230
end

0 commit comments

Comments
 (0)