]> gitweb.factorcode.org Git - factor.git/commitdiff
format-using: rename add-costs to cost+
authorAlexander Ilin <alex.ilin@protonmail.com>
Sat, 12 Aug 2023 22:23:13 +0000 (00:23 +0200)
committerAlexander Ilin <alex.ilin@protonmail.com>
Sat, 12 Aug 2023 22:23:13 +0000 (00:23 +0200)
extra/format-using/format-using.factor

index 112340d0b7ef0167f3d78a26441ec4ea2e0d44e6..aeff7d669e33f0bcec2b66d7ace6caa0d2a61af1 100644 (file)
@@ -24,7 +24,7 @@ IN: format-using
 : sum-too-long? ( cost1 cost2 -- ? )
     [ first ] [ second ] bi* + too-long? ;
 
-: add-costs ( cost1 cost2 -- total-cost )
+: cost+ ( cost1 cost2 -- total-cost )
     [ first3 ] bi@ roll prepend [ 2nip +  dup 3 - ] dip 3array ;
 
 : cluster? ( cost -- ? )
@@ -46,7 +46,7 @@ IN: format-using
     subsystem-clusters [ [ costs ] keep 3array ] map [
         { 0 0 f } [
             dup cluster? [ [ , ] bi@ { 0 0 f } ] [
-                2dup sum-too-long? [ swap , ] [ add-costs ] if
+                2dup sum-too-long? [ swap , ] [ cost+ ] if
             ] if
         ] reduce ,
     ] { } make [ first zero? ] reject