Handbook
Glossary
short-section? ( section -- ? )
Factor handbook
»
Developer tools
»
The prettyprinter
»
Extending the prettyprinter
»
Prettyprinter sections
»
Prettyprinter section protocol
Prev:
newline-after? ( section -- ? )
Next:
short-section ( section -- )
Vocabulary
prettyprint
.
sections
Inputs
section
a
section
Outputs
?
a
boolean
Generic word contract
Tests if a section should be output as a
short-section
. The default implementation calls
section-fits?
but this behavior can be customized.
Definition
IN:
prettyprint.sections
GENERIC:
short-section?
( section -- ? )
Methods
USING:
accessors
combinators.short-circuit
kernel
math
prettyprint.sections
;
M:
flow
short-section?
{
[
section-fits?
]
[
[
end>>
1
-
]
[
start>>
]
bi
-
text-fits?
not
]
}
1||
;
USING:
kernel
prettyprint.sections
;
M:
object
short-section?
section-fits?
;