Update all new Tasks

This commit is contained in:
Ingy döt Net 2015-02-20 09:02:09 -05:00
parent 00a190b0a6
commit 91df62d461
5697 changed files with 93386 additions and 804 deletions

View file

@ -0,0 +1,7 @@
proc fold {lambda zero list} {
set accumulator $zero
foreach item $list {
set accumulator [apply $lambda $accumulator $item]
}
return $accumulator
}

View file

@ -0,0 +1,5 @@
set 1to5 {1 2 3 4 5}
puts [fold {{a b} {expr {$a+$b}}} 0 $1to5]
puts [fold {{a b} {expr {$a*$b}}} 1 $1to5]
puts [fold {{a b} {return $a,$b}} x $1to5]

View file

@ -0,0 +1,3 @@
puts [::tcl::mathop::+ {*}$1to5]
puts [::tcl::mathop::* {*}$1to5]
puts x,[join $1to5 ,]