-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathDump.jl
50 lines (39 loc) · 1.12 KB
/
Dump.jl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
### A Pluto.jl notebook ###
# v0.11.14
using Markdown
using InteractiveUtils
# ╔═╡ 1d015dd4-009f-11eb-3247-994e422271f6
mutable struct A
x
y
end
# ╔═╡ 2d9d28da-009f-11eb-3319-e340c790b132
circ = let
one = A(1,2)
two = A(3,one)
one.y = two
one
end
# ╔═╡ 3724f462-009f-11eb-2a39-2b8672d3e8bd
"""
Dump(x; maxdepth=8)
Show every part of the representation of a value. The depth of the output is truncated at maxdepth.
This is a variant of [`Base.dump`](@ref) that returns the representation directly, instead of printing it to stdout.
"""
function Dump(x; maxdepth=8)
sprint() do io
dump(io, x; maxdepth=maxdepth)
end |> Text
end
# ╔═╡ 6ffb144e-009f-11eb-083d-3f9cbe0bcd9a
Dump(:(f(x) = 1123))
# ╔═╡ 7bbcbde6-009f-11eb-3dc9-7369a6b2b681
Dump(circ)
# ╔═╡ bf9f3c9e-00a1-11eb-0fa5-9b88d1f0f500
# ╔═╡ Cell order:
# ╠═1d015dd4-009f-11eb-3247-994e422271f6
# ╠═2d9d28da-009f-11eb-3319-e340c790b132
# ╠═6ffb144e-009f-11eb-083d-3f9cbe0bcd9a
# ╠═7bbcbde6-009f-11eb-3dc9-7369a6b2b681
# ╠═3724f462-009f-11eb-2a39-2b8672d3e8bd
# ╠═bf9f3c9e-00a1-11eb-0fa5-9b88d1f0f500