Fix sorting.human docs
parent
2e72e91f92
commit
7d1fa695c2
|
@ -6,8 +6,8 @@ IN: sorting.human
|
||||||
|
|
||||||
HELP: find-numbers
|
HELP: find-numbers
|
||||||
{ $values
|
{ $values
|
||||||
{ "string" string }
|
{ "sequence" sequence }
|
||||||
{ "seq" sequence }
|
{ "sequence'" sequence }
|
||||||
}
|
}
|
||||||
{ $description "Splits a string on numbers and returns a sequence of sequences and integers." } ;
|
{ $description "Splits a string on numbers and returns a sequence of sequences and integers." } ;
|
||||||
|
|
||||||
|
|
|
@ -5,13 +5,13 @@ sequences sorting.functor strings unicode.case
|
||||||
unicode.categories unicode.collation ;
|
unicode.categories unicode.collation ;
|
||||||
IN: sorting.human
|
IN: sorting.human
|
||||||
|
|
||||||
: cut-find ( seq pred -- before after )
|
: cut-find ( sequence pred -- before after )
|
||||||
[ drop ] [ find drop ] 2bi dup [ cut ] when ; inline
|
[ drop ] [ find drop ] 2bi dup [ cut ] when ; inline
|
||||||
|
|
||||||
: cut3 ( seq pred -- first mid last )
|
: cut3 ( sequence pred -- first mid last )
|
||||||
[ cut-find ] keep [ not ] compose cut-find ; inline
|
[ cut-find ] keep [ not ] compose cut-find ; inline
|
||||||
|
|
||||||
: find-sequences ( sequence pred quot -- seq )
|
: find-sequences ( sequence pred quot -- sequences )
|
||||||
'[
|
'[
|
||||||
[
|
[
|
||||||
_ cut3 [
|
_ cut3 [
|
||||||
|
@ -21,7 +21,7 @@ IN: sorting.human
|
||||||
] loop drop
|
] loop drop
|
||||||
] { } make ; inline
|
] { } make ; inline
|
||||||
|
|
||||||
: find-numbers ( seq -- newseq )
|
: find-numbers ( sequence -- sequence' )
|
||||||
[ digit? ] [ string>number ] find-sequences ;
|
[ digit? ] [ string>number ] find-sequences ;
|
||||||
|
|
||||||
! For comparing integers or sequences
|
! For comparing integers or sequences
|
||||||
|
|
Loading…
Reference in New Issue