tools.seq: adding "seq" tool.
parent
54595382ff
commit
a1b3886327
|
@ -0,0 +1 @@
|
|||
John Benediktsson
|
|
@ -0,0 +1,15 @@
|
|||
USING: tools.deploy.config ;
|
||||
H{
|
||||
{ deploy-name "seq" }
|
||||
{ deploy-ui? f }
|
||||
{ deploy-c-types? f }
|
||||
{ deploy-console? t }
|
||||
{ deploy-unicode? f }
|
||||
{ "stop-after-last-window?" t }
|
||||
{ deploy-io 3 }
|
||||
{ deploy-reflection 6 }
|
||||
{ deploy-word-props? f }
|
||||
{ deploy-math? t }
|
||||
{ deploy-threads? t }
|
||||
{ deploy-word-defs? f }
|
||||
}
|
|
@ -0,0 +1,23 @@
|
|||
! Copyright (C) 2011 John Benediktsson
|
||||
! See http://factorcode.org/license.txt for BSD license
|
||||
|
||||
USING: combinators command-line io kernel math.order math.parser
|
||||
math.ranges namespaces sequences ;
|
||||
|
||||
IN: tools.seq
|
||||
|
||||
: usage ( -- )
|
||||
"Usage: seq [first [incr]] last" print ;
|
||||
|
||||
: seq ( a step b -- )
|
||||
swap <range> [ number>string print ] each ;
|
||||
|
||||
: run-seq ( -- )
|
||||
command-line get dup length {
|
||||
{ 1 [ first string>number [ 1 1 ] dip seq ] }
|
||||
{ 2 [ first2 [ string>number ] bi@ 2dup before? 1 -1 ? swap seq ] }
|
||||
{ 3 [ first3 [ string>number ] tri@ seq ] }
|
||||
[ 2drop usage ]
|
||||
} case ;
|
||||
|
||||
MAIN: run-seq
|
Loading…
Reference in New Issue