]> gitweb.factorcode.org Git - factor.git/commitdiff
fixing compiler warnings
authorDoug Coleman <erg@jobim.local>
Fri, 17 Apr 2009 16:14:16 +0000 (11:14 -0500)
committerDoug Coleman <erg@jobim.local>
Fri, 17 Apr 2009 16:14:16 +0000 (11:14 -0500)
extra/coroutines/coroutines.factor
extra/graph-theory/graph-theory.factor
extra/math/numerical-integration/numerical-integration.factor

index 51276336e352bfadc0e6b008ea70747a6442bd88..6b334822c093083e79a1c7b014958a78d1130c1d 100644 (file)
@@ -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 ;
index b14832dc032d5adde898189cc311fcabda093f81..1b4224c864727a704c017979c10d2fb7e89b239f 100644 (file)
@@ -1,8 +1,7 @@
 ! Copyright (C) 2008 William Schlieper <schlieper@unc.edu>
 ! 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 ;
index 6b46ba02430a6e78464ba76bed93907128296957..261f33c4f3aa30540826f7f4aa7ae9929095e1d4 100644 (file)
@@ -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 } <repetition> 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