Use bl in more places.
parent
7bf1173bc3
commit
e74f770b57
|
@ -106,7 +106,7 @@ M: timestamp year. ( timestamp -- )
|
|||
#! RFC822 timestamp format
|
||||
#! Example: Tue, 15 Nov 1994 08:12:31 +0200
|
||||
[
|
||||
[ (timestamp>string) " " write ]
|
||||
[ (timestamp>string) bl ]
|
||||
[ gmt-offset>> write-gmt-offset ]
|
||||
bi
|
||||
] with-string-writer ;
|
||||
|
|
|
@ -208,12 +208,12 @@ DEFER: (profile.)
|
|||
|
||||
:: times. ( node -- )
|
||||
node {
|
||||
[ depth>> number>string 4 CHAR: \s pad-head write " " write ]
|
||||
[ total-time>> duration. " " write ]
|
||||
[ [ gc-time>> ] [ total-time>> ] bi percentage. " " write ]
|
||||
[ [ jit-time>> ] [ total-time>> ] bi percentage. " " write ]
|
||||
[ [ foreign-time>> ] [ total-time>> ] bi percentage. " " write ]
|
||||
[ [ foreign-thread-time>> ] [ total-time>> ] bi percentage. " " write ]
|
||||
[ depth>> number>string 4 CHAR: \s pad-head write bl ]
|
||||
[ total-time>> duration. bl ]
|
||||
[ [ gc-time>> ] [ total-time>> ] bi percentage. bl ]
|
||||
[ [ jit-time>> ] [ total-time>> ] bi percentage. bl ]
|
||||
[ [ foreign-time>> ] [ total-time>> ] bi percentage. bl ]
|
||||
[ [ foreign-thread-time>> ] [ total-time>> ] bi percentage. bl ]
|
||||
} cleave ;
|
||||
|
||||
:: (profile-node.) ( word node depth -- )
|
||||
|
|
|
@ -142,8 +142,8 @@ M: public-id write-xml
|
|||
|
||||
M: doctype-decl write-xml
|
||||
?indent "<!DOCTYPE " write
|
||||
[ name>> write " " write ]
|
||||
[ external-id>> [ write-xml " " write ] when* ]
|
||||
[ name>> write bl ]
|
||||
[ external-id>> [ write-xml bl ] when* ]
|
||||
[ internal-subset>> write-internal-subset ">" write ] tri ;
|
||||
|
||||
M: directive write-xml
|
||||
|
|
|
@ -28,7 +28,7 @@ IN: benchmark.mandel
|
|||
|
||||
: ppm-header ( -- )
|
||||
ascii encode-output
|
||||
"P6\n" write width pprint " " write height pprint "\n255\n" write
|
||||
"P6\n" write width pprint bl height pprint "\n255\n" write
|
||||
binary encode-output ; inline
|
||||
|
||||
: mandel-benchmark ( -- )
|
||||
|
|
|
@ -539,7 +539,7 @@ SYMBOL: rom-root
|
|||
[ " A: " write a>> >hex 2 CHAR: \s pad-head write ] keep
|
||||
[ " SP: " write sp>> >hex 4 CHAR: \s pad-head write ] keep
|
||||
[ " cycles: " write cycles>> number>string 5 CHAR: \s pad-head write ] keep
|
||||
[ " " write peek-instruction name>> write " " write ] keep
|
||||
[ bl peek-instruction name>> write bl ] keep
|
||||
nl drop ;
|
||||
|
||||
: cpu*. ( cpu -- )
|
||||
|
|
|
@ -411,9 +411,9 @@ M: ptx-target (write-ptx-element)
|
|||
M: ptx-variable (write-ptx-element)
|
||||
dup extern?>> [ ".extern " write ] when
|
||||
dup visible?>> [ ".visible " write ] when
|
||||
dup align>> [ ".align " write number>string write " " write ] when*
|
||||
dup storage-space>> (write-ptx-element) " " write
|
||||
dup type>> (write-ptx-element) " " write
|
||||
dup align>> [ ".align " write number>string write bl ] when*
|
||||
dup storage-space>> (write-ptx-element) bl
|
||||
dup type>> (write-ptx-element) bl
|
||||
dup name>> write
|
||||
dup parameter>> [ "<" write number>string write ">" write ] when*
|
||||
dup dim>> [ write-ptx-dim ] when*
|
||||
|
@ -432,7 +432,7 @@ M: ptx-variable (write-ptx-element)
|
|||
|
||||
: write-entry ( entry -- )
|
||||
dup name>> write
|
||||
dup params>> [ " " write write-params ] when* nl
|
||||
dup params>> [ bl write-params ] when* nl
|
||||
dup directives>> [ (write-ptx-element) nl ] each
|
||||
dup body>> write-body
|
||||
drop ;
|
||||
|
@ -467,11 +467,11 @@ M: ptx-instruction ptx-element-label
|
|||
|
||||
: write-insn ( insn name -- insn )
|
||||
over predicate>>
|
||||
[ "@" write write-ptx-operand " " write ] when*
|
||||
[ "@" write write-ptx-operand bl ] when*
|
||||
write ;
|
||||
|
||||
: write-2op ( insn -- )
|
||||
dup type>> (write-ptx-element) " " write
|
||||
dup type>> (write-ptx-element) bl
|
||||
dup dest>> write-ptx-operand ", " write
|
||||
dup a>> write-ptx-operand
|
||||
drop ;
|
||||
|
@ -586,7 +586,7 @@ M: bfind (write-ptx-element)
|
|||
write-2op ;
|
||||
M: bra (write-ptx-element)
|
||||
"bra" write-insn
|
||||
dup write-uni " " write
|
||||
dup write-uni bl
|
||||
target>> write ;
|
||||
M: brev (write-ptx-element)
|
||||
"brev" write-insn
|
||||
|
@ -595,7 +595,7 @@ M: brkpt (write-ptx-element)
|
|||
"brkpt" write-insn drop ;
|
||||
M: call (write-ptx-element)
|
||||
"call" write-insn
|
||||
dup write-uni " " write
|
||||
dup write-uni bl
|
||||
dup return>> [ "(" write write-ptx-operand "), " write ] when*
|
||||
dup target>> write
|
||||
dup params>> [ ", (" write [ ", " write ] [ write-ptx-operand ] interleave ")" write ] unless-empty
|
||||
|
@ -641,7 +641,7 @@ M: fma (write-ptx-element)
|
|||
M: isspacep (write-ptx-element)
|
||||
"isspacep" write-insn
|
||||
dup storage-space>> (write-ptx-element)
|
||||
" " write
|
||||
bl
|
||||
dup dest>> write-ptx-operand ", " write a>> write-ptx-operand ;
|
||||
M: ld (write-ptx-element)
|
||||
"ld" write-insn
|
||||
|
@ -694,7 +694,7 @@ M: or (write-ptx-element)
|
|||
"or" write-insn
|
||||
write-3op ;
|
||||
M: pmevent (write-ptx-element)
|
||||
"pmevent" write-insn " " write a>> write ;
|
||||
"pmevent" write-insn bl a>> write ;
|
||||
M: popc (write-ptx-element)
|
||||
"popc" write-insn
|
||||
write-2op ;
|
||||
|
@ -702,15 +702,15 @@ M: prefetch (write-ptx-element)
|
|||
"prefetch" write-insn
|
||||
dup storage-space>> (write-ptx-element)
|
||||
dup level>> (write-ptx-element)
|
||||
" " write a>> write-ptx-operand ;
|
||||
bl a>> write-ptx-operand ;
|
||||
M: prefetchu (write-ptx-element)
|
||||
"prefetchu" write-insn
|
||||
dup level>> (write-ptx-element)
|
||||
" " write a>> write-ptx-operand ;
|
||||
bl a>> write-ptx-operand ;
|
||||
M: prmt (write-ptx-element)
|
||||
"prmt" write-insn
|
||||
dup type>> (write-ptx-element)
|
||||
dup mode>> (write-ptx-element) " " write
|
||||
dup mode>> (write-ptx-element) bl
|
||||
dup dest>> write-ptx-operand ", " write
|
||||
dup a>> write-ptx-operand ", " write
|
||||
dup b>> write-ptx-operand ", " write
|
||||
|
@ -749,7 +749,7 @@ M: set (write-ptx-element)
|
|||
M: setp (write-ptx-element)
|
||||
"setp" write-insn
|
||||
dup write-set
|
||||
dup type>> (write-ptx-element) " " write
|
||||
dup type>> (write-ptx-element) bl
|
||||
dup dest>> write-ptx-operand
|
||||
dup |dest>> [ "|" write write-ptx-operand ] when* ", " write
|
||||
dup a>> write-ptx-operand ", " write
|
||||
|
|
|
@ -20,7 +20,7 @@ SYMBOL: :restarts
|
|||
compute-restarts :restarts prefix ; inline
|
||||
|
||||
: fuel-pprint-sequence ( seq open close -- )
|
||||
[ write ] dip swap [ " " write ] [ fuel-pprint ] interleave write ; inline
|
||||
[ write ] dip swap [ bl ] [ fuel-pprint ] interleave write ; inline
|
||||
|
||||
PRIVATE>
|
||||
|
||||
|
|
|
@ -71,6 +71,6 @@ M: +middle+ align-string
|
|||
|
||||
: print-aligned ( text alignment -- )
|
||||
[ split-and-pad flip ] dip align-columns flip
|
||||
[ [ write " " write ] each nl ] each ;
|
||||
[ [ write bl ] each nl ] each ;
|
||||
|
||||
! USAGE: example-text +left+ print-aligned
|
||||
|
|
|
@ -88,7 +88,7 @@ CONSTANT: example-tree
|
|||
] while drop ; inline
|
||||
|
||||
: tree-traversal-main ( -- )
|
||||
example-tree [ number>string write " " write ] {
|
||||
example-tree [ number>string write bl ] {
|
||||
[ "preorder: " write preorder nl ]
|
||||
[ "inorder: " write inorder nl ]
|
||||
[ "postorder: " write postorder nl ]
|
||||
|
|
|
@ -42,7 +42,7 @@ CONSTANT: tweet-metadata-style
|
|||
tweet-username-style [
|
||||
dup user>> screen-name>> write
|
||||
] with-style
|
||||
" " write dup text>> print
|
||||
bl dup text>> print
|
||||
|
||||
tweet-metadata-style [
|
||||
dup created-at>> write
|
||||
|
|
Loading…
Reference in New Issue