wrap: use infimum-by instead of min-by.

db4
John Benediktsson 2015-07-20 10:50:01 -07:00
parent b8086f7dd5
commit 46fbfe3ff0
1 changed files with 1 additions and 7 deletions

View File

@ -24,12 +24,6 @@ TYPED: fits? ( paragraph: paragraph -- ? )
! Make this not count spaces at end
{ [ lines>> car 1list? ] [ top-fits? ] } 1|| ; inline
:: min-by ( seq quot -- elt )
f 1/0. seq [| key value newkey |
newkey quot call :> newvalue
newvalue value < [ newkey newvalue ] [ key value ] if
] each drop ; inline
TYPED: paragraph-cost ( paragraph: paragraph -- cost )
dup lines>> 1list? [ drop 0 ] [
[ [ head-width>> ] [ line-ideal>> ] bi - sq ]
@ -37,7 +31,7 @@ TYPED: paragraph-cost ( paragraph: paragraph -- cost )
] if ; inline
: min-cost ( paragraphs -- paragraph )
[ paragraph-cost ] min-by ; inline
[ paragraph-cost ] infimum-by ; inline
TYPED: new-line ( paragraph: paragraph element: element -- paragraph )
{