2007-09-20 18:09:08 -04:00
|
|
|
|
2008-06-24 14:47:54 -04:00
|
|
|
USING: kernel sequences math combinators.lib combinators.short-circuit ;
|
2007-09-20 18:09:08 -04:00
|
|
|
|
|
|
|
IN: lsys.strings
|
|
|
|
|
|
|
|
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
|
|
|
2008-06-10 10:07:45 -04:00
|
|
|
: has-param? ( slice -- ? ) { [ length 1 > ] [ second CHAR: ( = ] } 1&& ;
|
2007-09-20 18:09:08 -04:00
|
|
|
|
2007-10-11 15:14:12 -04:00
|
|
|
: next+rest ( slice -- next rest ) [ 1 head ] [ 1 tail-slice ] bi ;
|
2007-09-20 18:09:08 -04:00
|
|
|
|
2007-10-11 15:14:12 -04:00
|
|
|
: index-rest ( slice -- i ) CHAR: ) swap index 1+ ;
|
2007-09-20 18:09:08 -04:00
|
|
|
|
2007-10-11 15:14:12 -04:00
|
|
|
: next+rest* ( slice -- next rest ) dup index-rest [ head ] [ tail-slice ] 2bi ;
|