]> gitweb.factorcode.org Git - factor.git/commitdiff
sigma -> map-sum
authorDoug Coleman <doug.coleman@gmail.com>
Thu, 29 Oct 2009 19:34:04 +0000 (14:34 -0500)
committerDoug Coleman <doug.coleman@gmail.com>
Thu, 29 Oct 2009 19:34:04 +0000 (14:34 -0500)
32 files changed:
basis/compiler/cfg/builder/builder-tests.factor
basis/compiler/cfg/gc-checks/gc-checks.factor
basis/fry/fry.factor
basis/math/primes/erato/erato-tests.factor
basis/math/statistics/statistics.factor
basis/pack/pack.factor
basis/roman/roman.factor
basis/tools/profiler/profiler.factor
basis/ui/gadgets/paragraphs/paragraphs.factor
core/classes/tuple/tuple.factor
core/sequences/sequences-docs.factor
core/sequences/sequences-tests.factor
core/sequences/sequences.factor
extra/benchmark/backtrack/backtrack.factor
extra/benchmark/e-ratios/e-ratios.factor
extra/benchmark/tuple-arrays/tuple-arrays.factor
extra/project-euler/021/021.factor
extra/project-euler/028/028.factor
extra/project-euler/030/030.factor
extra/project-euler/034/034.factor
extra/project-euler/043/043.factor
extra/project-euler/048/048.factor
extra/project-euler/053/053.factor
extra/project-euler/063/063.factor
extra/project-euler/072/072.factor
extra/project-euler/074/074.factor
extra/project-euler/092/092.factor
extra/project-euler/116/116.factor
extra/project-euler/190/190.factor
extra/project-euler/common/common.factor
misc/vim/syntax/factor.vim
unmaintained/graph-theory/graph-theory.factor

index a4651b87b56658b86b81a7ae1d7bf870cb58ef43..9d1502d3f0165ee939c4cb9c479f0336495c97f4 100644 (file)
@@ -162,7 +162,7 @@ IN: compiler.cfg.builder.tests
 
 : count-insns ( quot insn-check -- ? )
     [ test-mr [ instructions>> ] map ] dip
-    '[ _ count ] sigma ; inline
+    '[ _ count ] map-sum ; inline
 
 : contains-insn? ( quot insn-check -- ? )
     count-insns 0 > ; inline
index 5d3c79e40f60e22c0dd4a3f3517d0eb13385aca9..7285685b4889b18602806e618f23a36b51a8fa77 100644 (file)
@@ -26,7 +26,7 @@ M: ##box-alien allocation-size* drop 4 cells ;
 M: ##box-displaced-alien allocation-size* drop 4 cells ;
 
 : allocation-size ( bb -- n )
-    instructions>> [ ##allocation? ] filter [ allocation-size* ] sigma ;
+    instructions>> [ ##allocation? ] filter [ allocation-size* ] map-sum ;
 
 : insert-gc-check ( bb -- )
     dup dup '[
@@ -44,4 +44,4 @@ M: ##box-displaced-alien allocation-size* drop 4 cells ;
     dup blocks-with-gc [
         over compute-uninitialized-sets
         [ insert-gc-check ] each
-    ] unless-empty ;
\ No newline at end of file
+    ] unless-empty ;
index d68e2d13a82a3edb6b4b30b7c1ac28d97eef2fdf..184c6247a6004e32ba3b7b898aa5bdbb5990be84 100644 (file)
@@ -32,7 +32,7 @@ PREDICATE: fry-specifier < word { _ @ } member-eq? ;
 
 GENERIC: count-inputs ( quot -- n )
 
-M: callable count-inputs [ count-inputs ] sigma ;
+M: callable count-inputs [ count-inputs ] map-sum ;
 M: fry-specifier count-inputs drop 1 ;
 M: object count-inputs drop 0 ;
 
index e78e5210f94c2b37eb76c1538a98388dcb27f256..e6f7765bd693e8996b06b43083025a3f10b49bb4 100644 (file)
@@ -7,4 +7,4 @@ USING: byte-arrays math math.bitwise math.primes.erato sequences tools.test ;
 [ t ] [ 113 100 sieve marked-prime? ] unit-test
 
 ! There are 25997 primes below 300000. 1 must be removed and 3 5 7 added.
-[ 25997 ] [ 299999 sieve [ bit-count ] sigma 2 + ] unit-test
\ No newline at end of file
+[ 25997 ] [ 299999 sieve [ bit-count ] map-sum 2 + ] unit-test
index a1a214b2c015cebc694ac06e52bbbbb7b3e97e98..85909bc097497d5131dadbb640d02c86aa1422f7 100644 (file)
@@ -12,7 +12,7 @@ IN: math.statistics
     [ length ] [ product ] bi nth-root ;
 
 : harmonic-mean ( seq -- x )
-    [ recip ] sigma recip ;
+    [ recip ] map-sum recip ;
 
 :: kth-smallest ( seq k -- elt )
     #! Wirth's method, Algorithm's + Data structues = Programs p. 84
@@ -75,7 +75,7 @@ IN: math.statistics
     dup length 1 <= [
         drop 0
     ] [
-        [ [ mean ] keep [ - sq ] with sigma ]
+        [ [ mean ] keep [ - sq ] with map-sum ]
         [ length 1 - ] bi /
     ] if ;
 
index 3b9739fb0f143dc6169b06dcfb972737d1de99b3..a330337c5e992b391eeb30e7233d5806714d0b1b 100755 (executable)
@@ -97,7 +97,7 @@ MACRO: pack ( str -- quot )
     packed-length-table at ; inline
 
 : packed-length ( str -- n )
-    [ ch>packed-length ] sigma ;
+    [ ch>packed-length ] map-sum ;
  
 : pack-native ( seq str -- seq )
     '[ _ _ pack ] with-native-endian ; inline
index bc86db31c6444399493858c62f4ae219cc0563e5..f8c7da9ab46be6deb0d6391b5cf07d149ad16471 100644 (file)
@@ -43,7 +43,7 @@ PRIVATE>
 : >ROMAN ( n -- str ) >roman >upper ;
 
 : roman> ( str -- n )
-    >lower [ roman>= ] monotonic-split [ (roman>) ] sigma ;
+    >lower [ roman>= ] monotonic-split [ (roman>) ] map-sum ;
 
 <PRIVATE
 
index 219344db3b0b2cfd364d3e86290111c39b3bbc92..626fdab826475b3d3122974cce7cb195015e2585 100644 (file)
@@ -19,7 +19,7 @@ IN: tools.profiler
     [ dup counter>> ] map-counters ;
 
 : cumulative-counters ( obj quot -- alist )
-    '[ dup @ [ counter>> ] sigma ] map-counters ; inline
+    '[ dup @ [ counter>> ] map-sum ] map-counters ; inline
 
 : vocab-counters ( -- alist )
     vocabs [ words [ predicate? not ] filter ] cumulative-counters ;
index fd5ae0b246646f81f3745a2036d54d4a3ebf1f3f..12de4bacd9a30e213df09ca9164d274bbd104f75 100644 (file)
@@ -40,7 +40,7 @@ TUPLE: line words height ;
     dup wrap-words [ <line> ] map ;
 
 : line-width ( wrapped-line -- n )
-    [ break?>> ] trim-tail-slice [ width>> ] sigma ;
+    [ break?>> ] trim-tail-slice [ width>> ] map-sum ;
 
 : max-line-width ( wrapped-paragraph -- x )
     [ words>> line-width ] [ max ] map-reduce ;
@@ -82,4 +82,4 @@ M: paragraph baseline
 
 M: paragraph cap-height pack-cap-height ;
     
-PRIVATE>
\ No newline at end of file
+PRIVATE>
index ccb4e30c31f4a5ecfb5188e60dd8d44109fbdac0..3e449e624ece3f64c43c0ec2282cddcba149ab94 100755 (executable)
@@ -118,7 +118,7 @@ ERROR: bad-superclass class ;
     } case define-predicate ;
 
 : class-size ( class -- n )
-    superclasses [ "slots" word-prop length ] sigma ;
+    superclasses [ "slots" word-prop length ] map-sum ;
 
 : (instance-check-quot) ( class -- quot )
     [
index 8851628b21c78753aae6cf83589c7acc1eec237b..224702185e82d01bb97afdc792025156645110bc 100755 (executable)
@@ -975,13 +975,12 @@ HELP: produce-as
 { $description "Calls " { $snippet "pred" } " repeatedly. If the predicate yields " { $link f } ", stops, otherwise, calls " { $snippet "quot" } " to yield a value. Values are accumulated and returned in a sequence of type " { $snippet "exemplar" } " at the end." }
 { $examples "See " { $link produce } " for examples." } ;
 
-HELP: sigma
+HELP: map-sum
 { $values { "seq" sequence } { "quot" quotation } { "n" number } }
 { $description "Like map sum, but without creating an intermediate sequence." }
 { $example
-    "! Find the sum of the squares [0,99]"
     "USING: math math.ranges sequences prettyprint ;"
-    "100 [1,b] [ sq ] sigma ."
+    "100 [1,b] [ sq ] map-sum ."
     "338350"
 } ;
 
index dc99542da83996356a526b7982103dce714bf892..c82caec3f9769772d61069f7a01fba6b122e7f23 100644 (file)
@@ -243,7 +243,7 @@ unit-test
 [ "asdf " ] [ " asdf " [ CHAR: \s = ] trim-head ] unit-test
 [ " asdf" ] [ " asdf " [ CHAR: \s = ] trim-tail ] unit-test
 
-[ 328350 ] [ 100 [ sq ] sigma ] unit-test
+[ 328350 ] [ 100 [ sq ] map-sum ] unit-test
 
 [ 50 ] [ 100 [ even? ] count ] unit-test
 [ 50 ] [ 100 [ odd?  ] count ] unit-test
index 81e5401c4ba029047404b9045eeb792c714315cd..9298a719e0562f4d5b341d6023eb36e3b5b5085d 100755 (executable)
@@ -934,10 +934,10 @@ PRIVATE>
 
 : supremum ( seq -- n ) [ ] [ max ] map-reduce ;
 
-: sigma ( seq quot -- n )
+: map-sum ( seq quot -- n )
     [ 0 ] 2dip [ dip + ] curry [ swap ] prepose each ; inline
 
-: count ( seq quot -- n ) [ 1 0 ? ] compose sigma ; inline
+: count ( seq quot -- n ) [ 1 0 ? ] compose map-sum ; inline
 
 ! We hand-optimize flip to such a degree because type hints
 ! cannot express that an array is an array of arrays yet, and
index 27040edac3e5909afc5d852916f78b5ba93a8ba2..856fd8e25d07bc6ac27533f8d95d892f552e9f1b 100755 (executable)
@@ -38,9 +38,9 @@ MEMO: 24-from-4 ( a b c d -- ? )
                 1 10 [a,b] [| d |
                     a b c d 24-from-4
                 ] count
-            ] sigma
-        ] sigma
-    ] sigma ;
+            ] map-sum
+        ] map-sum
+    ] map-sum ;
 
 CONSTANT: words { 24-from-1 24-from-2 24-from-3 24-from-4 }
 
index 4957822b5e85bf57f02b474842c7bb1e22c705a4..a909602f8c5d4b482a986be6cc0e366180c90c53 100644 (file)
@@ -4,7 +4,7 @@ USING: kernel math math.combinatorics math.ranges sequences ;
 IN: benchmark.e-ratios
 
 : calculate-e-ratios ( n -- e )
-    iota [ factorial recip ] sigma ;
+    iota [ factorial recip ] map-sum ;
 
 : calculate-e-ratios-benchmark ( -- )
     5 [ 300 calculate-e-ratios drop ] times ;
index bd9a7139b3c3511214088df988538e4e61a6d289..38ce0087a2c209d74f61cd97848bf320c23b86ae 100644 (file)
@@ -14,7 +14,7 @@ TUPLE-ARRAY: point
             [ 1 + ] change-x
             [ 1 - ] change-y
             [ 1 + 2 / ] change-z
-        ] map [ z>> ] sigma
-    ] sigma . ;
+        ] map [ z>> ] map-sum
+    ] map-sum . ;
 
 MAIN: tuple-array-benchmark
index 0401aad9be97579003073d1cf2887543989869ef..165d463a46f8d342c6cf9652ce3f70051ca89ffc 100644 (file)
@@ -30,7 +30,7 @@ IN: project-euler.021
     { [ = not ] [ sum-proper-divisors = ] } 2&& ;
 
 : euler021 ( -- answer )
-    10000 [1,b] [ dup amicable? [ drop 0 ] unless ] sigma ;
+    10000 [1,b] [ dup amicable? [ drop 0 ] unless ] map-sum ;
 
 ! [ euler021 ] 100 ave-time
 ! 335 ms ave run time - 18.63 SD (100 trials)
index 6dc284f802150b8dac480874ef51592b4fc1bb23..b134d369de13febc5ad1d172967aa0ee72eef53e 100644 (file)
@@ -33,7 +33,7 @@ IN: project-euler.028
     dup 1 = [ [ sq 4 * ] [ 6 * ] bi - 6 + ] unless ;
 
 : sum-diags ( n -- sum )
-    1 swap 2 <range> [ sum-corners ] sigma ;
+    1 swap 2 <range> [ sum-corners ] map-sum ;
 
 PRIVATE>
 
index b689df50bbd9e2d1c2979c3bd534885fcb9e867f..25d78d9465f58b533dcffe60980e7cdd6151b89a 100644 (file)
@@ -33,7 +33,7 @@ IN: project-euler.030
 <PRIVATE
 
 : sum-fifth-powers ( n -- sum )
-    number>digits [ 5 ^ ] sigma ;
+    number>digits [ 5 ^ ] map-sum ;
 
 PRIVATE>
 
index f7a4865da7aea861aa52fed58245a3b040498add..959c66fea4b0feed5b5a311ecb9ad849d7b8ee0d 100644 (file)
@@ -34,7 +34,7 @@ IN: project-euler.034
     { 1 1 2 6 24 120 720 5040 40320 362880 } nth ;
 
 : factorion? ( n -- ? )
-    dup number>digits [ digit-factorial ] sigma = ;
+    dup number>digits [ digit-factorial ] map-sum = ;
 
 PRIVATE>
 
index bea7313abd214ede4d5c55c6761f8d97464620f6..cf4955750636a769bdb4ba2e88086991ae5109e9 100644 (file)
@@ -92,7 +92,7 @@ PRIVATE>
 PRIVATE>
 
 : euler043a ( -- answer )
-    interesting-pandigitals [ 10 digits>integer ] sigma ;
+    interesting-pandigitals [ 10 digits>integer ] map-sum ;
 
 ! [ euler043a ] 100 ave-time
 ! 10 ms ave run time - 1.37 SD (100 trials)
index fde3fa6026af4a0adbfad6d9e50c53025d9b69e0..d0e267f73c834c98b7a428f172b637e4e8f90c40 100644 (file)
@@ -18,7 +18,7 @@ IN: project-euler.048
 ! --------
 
 : euler048 ( -- answer )
-    1000 [1,b] [ dup ^ ] sigma 10 10^ mod ;
+    1000 [1,b] [ dup ^ ] map-sum 10 10^ mod ;
 
 ! [ euler048 ] 100 ave-time
 ! 276 ms run / 1 ms GC ave time - 100 trials
index 111b8147fb59807cb18c03ec2e8234b92891e0e8..faca6a8ad56ce5c372767e0683282937ffb4f226 100644 (file)
@@ -27,7 +27,7 @@ IN: project-euler.053
 ! --------
 
 : euler053 ( -- answer )
-    23 100 [a,b] [ dup [ nCk 1000000 > ] with count ] sigma ;
+    23 100 [a,b] [ dup [ nCk 1000000 > ] with count ] map-sum ;
 
 ! [ euler053 ] 100 ave-time
 ! 52 ms ave run time - 4.44 SD (100 trials)
index 80e3990a2484bea2dedc95a52ae717aad046b925..59552db882cd75a9ee01ea24126577d55ba7fc42 100644 (file)
@@ -29,7 +29,7 @@ IN: project-euler.063
 ! Round down since we already know that particular value of n is no good.
 
 : euler063 ( -- answer )
-    9 [1,b] [ log [ 10 log dup ] dip - /i ] sigma ;
+    9 [1,b] [ log [ 10 log dup ] dip - /i ] map-sum ;
 
 ! [ euler063 ] 100 ave-time
 ! 0 ms ave run time - 0.0 SD (100 trials)
index 9fab6788bdb42687c359394ad06a8a8daac9c099..cdd11bb55c892b4fb6d71bce91948302f09d62cc 100644 (file)
@@ -30,7 +30,7 @@ IN: project-euler.072
 ! The answer can be found by adding totient(n) for 2 ≤ n ≤ 1e6
 
 : euler072 ( -- answer )
-    2 1000000 [a,b] [ totient ] sigma ;
+    2 1000000 [a,b] [ totient ] map-sum ;
 
 ! [ euler072 ] 100 ave-time
 ! 5274 ms ave run time - 102.7 SD (100 trials)
index 7f0a54a43cf951d08a86725b1387df149c5873a8..1fff789cf74af879d63cc0e41353395e93c51f09 100644 (file)
@@ -48,7 +48,7 @@ IN: project-euler.074
     { 1 1 2 6 24 120 720 5040 40320 362880 } nth ;
 
 : digits-factorial-sum ( n -- n )
-    number>digits [ digit-factorial ] sigma ;
+    number>digits [ digit-factorial ] map-sum ;
 
 : chain-length ( n -- n )
     61 <hashtable>
index 9f22460b3cb69cf34eb392e53490f9e2a033ece9..973572572d9383d52d20a29f49a35ce9865f4045 100644 (file)
@@ -29,7 +29,7 @@ IN: project-euler.092
 <PRIVATE
 
 : next-link ( n -- m )
-    number>digits [ sq ] sigma ;
+    number>digits [ sq ] map-sum ;
 
 : chain-ending ( n -- m )
     dup [ 1 = ] [ 89 = ] bi or [ next-link chain-ending ] unless ;
index 43eb30c9f691490721c17c3bf37004d4c69b1c29..50252582fa95dc9ef08c52061c648896d5ce585b 100644 (file)
@@ -47,7 +47,7 @@ IN: project-euler.116
     V{ 1 } clone [ [ next ] 2curry times ] keep last 1 - ;
 
 : (euler116) ( length -- permutations )
-    3 [1,b] [ ways ] with sigma ;
+    3 [1,b] [ ways ] with map-sum ;
 
 PRIVATE>
 
index 19ff2c253ca6f5520454d3c523507d116a981950..460580c7c01542ea1a288d37094554312a119b35 100644 (file)
@@ -46,7 +46,7 @@ PRIVATE>
     m [1,b] [| i | 2 i * m 1 + / i ^ ] PI ;
 
 : euler190 ( -- answer )
-    2 15 [a,b] [ P_m truncate ] sigma ;
+    2 15 [a,b] [ P_m truncate ] map-sum ;
 
 ! [ euler150 ] 100 ave-time
 ! 5 ms ave run time - 1.01 SD (100 trials)
index 3d320fad62f03679cfc2d626b4b6e20f50f76603..9eb9e968ca161c60b1f679206b873d88bf2772a4 100644 (file)
@@ -57,7 +57,7 @@ IN: project-euler.common
 PRIVATE>
 
 : alpha-value ( str -- n )
-    >lower [ CHAR: a - 1 + ] sigma ;
+    >lower [ CHAR: a - 1 + ] map-sum ;
 
 : cartesian-product ( seq1 seq2 -- seq1xseq2 )
     [ [ 2array ] with map ] curry map concat ;
index 13b999250d6ce5aa8eda22e070b23e68a3eeeb00..340cdff032d65cbf8dcf4fafcd459a1e11febf01 100644 (file)
@@ -53,7 +53,7 @@ syn keyword factorKeyword or tuck 2bi 2tri while wrapper nip 4dip wrapper? bi* c
 syn keyword factorKeyword ?at assoc? assoc-clone-like assoc= delete-at* assoc-partition extract-keys new-assoc value? assoc-size map>assoc push-at assoc-like key? assoc-intersect assoc-refine update assoc-union assoc-combine at* assoc-empty? at+ set-at assoc-all? assoc-subset? assoc-hashcode change-at assoc-each assoc-diff zip values value-at rename-at inc-at enum? at cache assoc>map <enum> assoc assoc-map enum value-at* assoc-map-as >alist assoc-filter-as clear-assoc assoc-stack maybe-set-at substitute assoc-filter 2cache delete-at assoc-find keys assoc-any? unzip
 syn keyword factorKeyword case execute-effect no-cond no-case? 3cleave>quot 2cleave cond>quot wrong-values? no-cond? cleave>quot no-case case>quot 3cleave wrong-values to-fixed-point alist>quot case-find cond cleave call-effect 2cleave>quot recursive-hashcode linear-case-quot spread spread>quot
 syn keyword factorKeyword byte-array>bignum sgn >bignum next-float number= each-integer next-power-of-2 ?1+ fp-special? imaginary-part mod recip float>bits rational >float number? 2^ bignum? integer fixnum? neg fixnum sq bignum fp-snan? fp-infinity? denominator (all-integers?) times find-last-integer (each-integer) bit? * + fp-bitwise= - fp-qnan? / power-of-2? >= bitand find-integer complex <fp-nan> < log2 > integer? real number bits>double double>bits bitor 2/ zero? rem fp-nan-payload all-integers? (find-integer) real-part prev-float align bits>float float? shift float fp-nan? abs bitxor ratio? even? <= /mod odd? >integer ratio rational? bitnot real? >fixnum complex? /i numerator /f
-syn keyword factorKeyword append assert-sequence= find-last-from trim-head-slice clone-like 3sequence assert-sequence? map-as filter! last-index-from reversed index-from cut* pad-tail (indices) concat-as remove-eq but-last snip trim-tail nths nth 2pusher sequence slice? <slice> partition remove-nth tail-slice empty? tail* if-empty find-from virtual-sequence? member? set-length remove-eq! drop-prefix unclip iota unclip-last-slice bounds-error? sequence-hashcode-step map start midpoint@ rest-slice prepend fourth sift delete sigma new-sequence follow like remove-nth! first4 1sequence reverse slice unless-empty padding virtual@ repetition? set-last index 4sequence max-length set-second immutable-sequence first2 first3 replicate-as reduce-index unclip-slice supremum insert-nth trim-tail-slice tail 3append short count suffix concat flip filter sum immutable? 2sequence map-integers delete-all start* indices snip-slice check-slice sequence? head map-find reduce append-as reverse! sequence= halves collapse-slice interleave 2map binary-reduce virtual-seq slice-error? product bounds-check? bounds-check harvest immutable find produce remove pad-head last replicate set-fourth shorten reversed? map-find-last 3map-as 2unclip-slice shorter? 3map find-last head-slice pop* 2map-as tail-slice* but-last-slice 2map-reduce iota? accumulate each pusher cut-slice new-resizable each-index head-slice* 2reverse-each sequence-hashcode member-eq? pop set-nth ?nth <flat-slice> second map! join when-empty accumulator immutable-sequence? <reversed> all? 3append-as virtual-sequence subseq? push-either new-like length last-index push-if 2all? lengthen assert-sequence copy map-reduce move third first 3each tail? set-first prefix bounds-error any? <repetition> trim-slice exchange surround 2reduce cut change-nth min-length set-third produce-as push-all head? delete-slice rest sum-lengths 2each head* infimum glue slice-error subseq replace-slice push repetition map-index trim-head unclip-last mismatch trim
+syn keyword factorKeyword append assert-sequence= find-last-from trim-head-slice clone-like 3sequence assert-sequence? map-as filter! last-index-from reversed index-from cut* pad-tail (indices) concat-as remove-eq but-last snip trim-tail nths nth 2pusher sequence slice? <slice> partition remove-nth tail-slice empty? tail* if-empty find-from virtual-sequence? member? set-length remove-eq! drop-prefix unclip iota unclip-last-slice bounds-error? sequence-hashcode-step map start midpoint@ rest-slice prepend fourth sift remove! map-sum new-sequence follow like remove-nth! first4 1sequence reverse slice unless-empty padding virtual@ repetition? set-last index 4sequence max-length set-second immutable-sequence first2 first3 replicate-as reduce-index unclip-slice supremum insert-nth trim-tail-slice tail 3append short count suffix concat flip filter sum immutable? 2sequence map-integers delete-all start* indices snip-slice check-slice sequence? head map-find reduce append-as reverse! sequence= halves collapse-slice interleave 2map binary-reduce virtual-seq slice-error? product bounds-check? bounds-check harvest immutable find produce remove pad-head last replicate set-fourth shorten reversed? map-find-last 3map-as 2unclip-slice shorter? 3map find-last head-slice pop* 2map-as tail-slice* but-last-slice 2map-reduce iota? accumulate each pusher cut-slice new-resizable each-index head-slice* 2reverse-each sequence-hashcode member-eq? pop set-nth ?nth <flat-slice> second map! join when-empty accumulator immutable-sequence? <reversed> all? 3append-as virtual-sequence subseq? push-either new-like length last-index push-if 2all? lengthen assert-sequence copy map-reduce move third first 3each tail? set-first prefix bounds-error any? <repetition> trim-slice exchange surround 2reduce cut change-nth min-length set-third produce-as push-all head? delete-slice rest sum-lengths 2each head* infimum glue slice-error subseq replace-slice push repetition map-index trim-head unclip-last mismatch trim
 syn keyword factorKeyword global +@ change set-namestack change-global init-namespaces on off set-global namespace set with-scope bind with-variable inc dec counter initialize namestack get get-global make-assoc
 syn keyword factorKeyword <array> 2array 3array pair >array 1array 4array pair? array resize-array array?
 syn keyword factorKeyword +character+ bad-seek-type? readln stream-seek read print with-output-stream contents write1 stream-write1 stream-copy stream-element-type with-input-stream stream-print stream-read stream-contents bl seek-output bad-seek-type nl stream-nl write flush stream-lines +byte+ stream-flush read1 seek-absolute? stream-read1 lines stream-readln stream-read-until each-line seek-end with-output-stream* seek-absolute with-streams seek-input seek-relative? input-stream stream-write read-partial seek-end? seek-relative error-stream read-until with-input-stream* with-streams* each-block output-stream stream-read-partial
index 1b4224c864727a704c017979c10d2fb7e89b239f..e14ffb4a83911b421f9ff29d816934a79742d79e 100644 (file)
@@ -34,7 +34,7 @@ M: graph num-vertices
     vertices length ;
 
 M: graph num-edges
-   [ vertices ] [ '[ _ adjlist length ] sigma ] bi ;
+   [ vertices ] [ '[ _ adjlist length ] map-sum ] bi ;
 
 M: graph adjlist
     [ vertices ] [ swapd '[ _ swap _ adj? ] filter ] bi ;