update core to use butlast, butlast-slice
parent
e771314833
commit
01f20cf32d
|
@ -102,7 +102,7 @@ ERROR: bad-superclass class ;
|
||||||
dup tuple-predicate-quot define-predicate ;
|
dup tuple-predicate-quot define-predicate ;
|
||||||
|
|
||||||
: superclass-size ( class -- n )
|
: superclass-size ( class -- n )
|
||||||
superclasses 1 head-slice*
|
superclasses butlast-slice
|
||||||
[ slot-names length ] map sum ;
|
[ slot-names length ] map sum ;
|
||||||
|
|
||||||
: generate-tuple-slots ( class slots -- slot-specs )
|
: generate-tuple-slots ( class slots -- slot-specs )
|
||||||
|
|
|
@ -32,7 +32,7 @@ IN: inference.transforms
|
||||||
drop [ no-case ]
|
drop [ no-case ]
|
||||||
] [
|
] [
|
||||||
dup peek quotation? [
|
dup peek quotation? [
|
||||||
dup peek swap 1 head*
|
dup peek swap butlast
|
||||||
] [
|
] [
|
||||||
[ no-case ] swap
|
[ no-case ] swap
|
||||||
] if case>quot
|
] if case>quot
|
||||||
|
|
|
@ -114,7 +114,7 @@ unit-test
|
||||||
[ parse-fresh drop ] with-compilation-unit
|
[ parse-fresh drop ] with-compilation-unit
|
||||||
[
|
[
|
||||||
"prettyprint.tests" lookup see
|
"prettyprint.tests" lookup see
|
||||||
] with-string-writer "\n" split 1 head*
|
] with-string-writer "\n" split butlast
|
||||||
] keep =
|
] keep =
|
||||||
] with-scope ;
|
] with-scope ;
|
||||||
|
|
||||||
|
|
|
@ -284,7 +284,7 @@ M: colon unindent-first-line? drop t ;
|
||||||
|
|
||||||
! Long section layout algorithm
|
! Long section layout algorithm
|
||||||
: chop-break ( seq -- seq )
|
: chop-break ( seq -- seq )
|
||||||
dup peek line-break? [ 1 head-slice* chop-break ] when ;
|
dup peek line-break? [ butlast-slice chop-break ] when ;
|
||||||
|
|
||||||
SYMBOL: prev
|
SYMBOL: prev
|
||||||
SYMBOL: next
|
SYMBOL: next
|
||||||
|
|
|
@ -104,7 +104,7 @@ M: sliced-clumps nth group@ <slice> ;
|
||||||
1array
|
1array
|
||||||
] [
|
] [
|
||||||
"\n" split [
|
"\n" split [
|
||||||
1 head-slice* [
|
butlast-slice [
|
||||||
"\r" ?tail drop "\r" split
|
"\r" ?tail drop "\r" split
|
||||||
] map
|
] map
|
||||||
] keep peek "\r" split suffix concat
|
] keep peek "\r" split suffix concat
|
||||||
|
|
Loading…
Reference in New Issue