% % merge two file lists, organizing by filename % % % stack: empty [ . . . ] empty [ . . . ] % [(Start)] % % reverse the order of the file list % { isnull ? % % put this entry on the bottom % [Bottom] } loop pop % % remember the count of file items % [Count] !counter % % stack: empty [ . . . ] % { isnull ? _counter zero ? [Pop] -:counter { 2 copy exch filename exch filename lt$ { % % the entry to join is less than the next stack item % push it to the bottom % exch [Bottom] second isnull) } { % % the entry to join is greater than or equal to the next stack item % push stack item to the bottom % [Bottom] true } ifelse ? } loop } loop isnull { _counter countup { pop [Pop] [Bottom] } for } { { isnull ? [Bottom] } loop } ifelse pop empty [Up] { pop [Pop] } for [(End)] % % stack: empty [ . . . ] %