1 ! Copyright (C) 2008 Doug Coleman, Slava Pestov.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: accessors kernel math math.order math.parser peg.ebnf
4 sequences sorting.functor ;
7 : find-numbers ( string -- seq )
8 [EBNF Result = ([0-9]+ => [[ string>number ]] | (!([0-9]) .)+)* EBNF] ;
10 ! For comparing integers or sequences
15 2dup [ integer? ] bi@ xor [
16 drop integer? [ +lt+ ] [ +gt+ ] if
21 << "human" [ find-numbers [ hybrid boa ] map ] define-sorting >>