2007-09-20 18:09:08 -04:00
|
|
|
|
2007-11-14 18:36:45 -05:00
|
|
|
USING: kernel sequences math combinators.cleave combinators.lib ;
|
2007-09-20 18:09:08 -04:00
|
|
|
|
|
|
|
IN: lsys.strings
|
|
|
|
|
|
|
|
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
|
|
|
2007-10-11 15:14:12 -04:00
|
|
|
: has-param? ( slice -- ? ) { [ length 1 > ] [ second CHAR: ( = ] } <-&& ;
|
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 ;
|