Coalescing in interval maps

db4
Daniel Ehrenberg 2008-05-05 23:46:51 -05:00
parent e82fb3b6dc
commit e3808cc503
1 changed files with 2 additions and 2 deletions

View File

@ -42,11 +42,11 @@ PRIVATE>
[ interval-node boa ] { } assoc>map
interval-map boa ;
:: coalesce ( assoc -- specification )
:: coalesce ( alist -- specification )
! Only works with integer keys, because they're discrete
! Makes 2array keys
[
assoc sort-keys unclip first2 dupd roll
alist sort-keys unclip first2 dupd roll
[| oldkey oldval key val | ! Underneath is start
oldkey 1+ key =
oldval val = and