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