diff --git a/extra/coroutines/coroutines.factor b/extra/coroutines/coroutines.factor index 51276336e3..6b334822c0 100644 --- a/extra/coroutines/coroutines.factor +++ b/extra/coroutines/coroutines.factor @@ -19,9 +19,10 @@ TUPLE: coroutine resumecc exitcc originalcc ; : coresume ( v co -- result ) [ >>exitcc - resumecc>> call + resumecc>> call( -- ) #! At this point, the coroutine quotation must have terminated - #! normally (without calling coyield, coreset, or coterminate). This shouldn't happen. + #! normally (without calling coyield, coreset, or coterminate). + #! This shouldn't happen. f over ] callcc1 2nip ; @@ -47,4 +48,4 @@ TUPLE: coroutine resumecc exitcc originalcc ; : coreset ( v -- ) current-coro get dup originalcc>> >>resumecc - exitcc>> continue-with ; \ No newline at end of file + exitcc>> continue-with ; diff --git a/extra/graph-theory/graph-theory.factor b/extra/graph-theory/graph-theory.factor index b14832dc03..1b4224c864 100644 --- a/extra/graph-theory/graph-theory.factor +++ b/extra/graph-theory/graph-theory.factor @@ -1,8 +1,7 @@ ! Copyright (C) 2008 William Schlieper ! See http://factorcode.org/license.txt for BSD license. - -USING: kernel combinators fry continuations sequences arrays vectors assocs hashtables heaps namespaces ; - +USING: kernel combinators fry continuations sequences arrays +vectors assocs hashtables heaps namespaces ; IN: graph-theory MIXIN: graph @@ -35,7 +34,7 @@ M: graph num-vertices vertices length ; M: graph num-edges - [ vertices ] [ '[ _ adjlist length ] map sum ] bi ; + [ vertices ] [ '[ _ adjlist length ] sigma ] bi ; M: graph adjlist [ vertices ] [ swapd '[ _ swap _ adj? ] filter ] bi ; @@ -88,5 +87,5 @@ PRIVATE> : topological-sort ( graph -- seq/f ) dup dag? - [ V{ } swap [ drop ] [ prefix ] [ ] full-depth-first drop ] + [ V{ } clone swap [ drop ] [ prefix ] [ ] full-depth-first drop ] [ drop f ] if ; diff --git a/extra/math/numerical-integration/numerical-integration.factor b/extra/math/numerical-integration/numerical-integration.factor index 6b46ba0243..261f33c4f3 100644 --- a/extra/math/numerical-integration/numerical-integration.factor +++ b/extra/math/numerical-integration/numerical-integration.factor @@ -1,7 +1,7 @@ ! Copyright (C) 2008 Doug Coleman. ! See http://factorcode.org/license.txt for BSD license. -USING: arrays kernel sequences namespaces make math math.ranges -math.vectors vectors ; +USING: kernel math math.ranges math.vectors namespaces +sequences ; IN: math.numerical-integration SYMBOL: num-steps @@ -15,7 +15,7 @@ SYMBOL: num-steps length 2 / 2 - { 2 4 } concat { 1 4 } { 1 } surround ; -: integrate-simpson ( from to f -- x ) +: integrate-simpson ( from to quot -- x ) [ setup-simpson-range dup ] dip map dup generate-simpson-weights - v. swap [ third ] keep first - 6 / * ; + v. swap [ third ] keep first - 6 / * ; inline