2 USING: kernel classes strings quotations words math math.parser arrays
5 system prettyprint splitting
6 sequences combinators sequences.deep
15 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
19 : to-string ( obj -- str )
23 { \ quotation [ call( -- string ) ] }
24 { \ word [ execute( -- string ) ] }
25 { \ fixnum [ number>string ] }
26 { \ array [ to-strings concat ] }
30 : to-strings ( seq -- str )
33 [ [ to-string ] map flatten ]
36 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
38 : cpu- ( -- cpu ) cpu unparse "." split "-" join ;
40 : platform ( -- string ) { [ os unparse ] cpu- } to-strings "-" join ;
42 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
44 : branch-name ( -- string ) "clean-" platform append ;
46 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
48 : gnu-make ( -- string )
51 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
54 { "git" "show" } utf8 <process-reader> [ readln ] with-input-stream
57 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
59 : datestamp ( -- string )
61 [ { [ year>> ] [ month>> ] [ day>> ] [ hour>> ] [ minute>> ] } cleave ] output>array
62 [ pad-00 ] map "-" join ;