Handbook
Glossary
pprint-json* ( obj -- )
Vocabulary
json
.
prettyprint
.
private
Inputs
obj
an
object
Outputs
None
Definition
IN:
json.prettyprint.private
GENERIC:
pprint-json*
( obj -- )
Methods
USING:
assocs
io
json.prettyprint.private
kernel
namespaces
sequences
;
M:
assoc
pprint-json*
dup
assoc-empty?
[
drop
"{ }"
write
]
[
"{"
print
indent-level
inc
>alist
[
","
print
]
[
first2
[
write-spaces
pprint-json*
": "
write
]
[
pprint-json*
]
bi*
]
interleave
nl
indent-level
dec
write-spaces
"}"
write
]
if
;
USING:
json
json.prettyprint.private
;
M:
f
pprint-json*
write-json
;
USING:
json
json.prettyprint.private
kernel
;
M:
object
pprint-json*
write-json
;
USING:
io
json.prettyprint.private
namespaces
sequences
;
M:
sequence
pprint-json*
[
"[ ]"
write
]
[
"["
print
indent-level
inc
[
","
print
]
[
write-spaces
pprint-json*
]
interleave
nl
indent-level
dec
write-spaces
"]"
write
]
if-empty
;
USING:
json
json.prettyprint.private
strings
;
M:
string
pprint-json*
write-json
;