++- Selene                                                 ** Veronica

sort = src @compare + dest ->                              (@ sort src @compare .dest +-
  dest = sort src SORT_ASC compare                             (# sort src SORT_ASC compare .dest)
_                                                          +
  src : list : <T>                                             {list : <T>} src
  dest : list : <T> : [src]                                    {list : <T> : [src]} dest
;                                                          )
                                                           (@ sort:rc list order-by @compare .sorted +-
sort -rc = list order-by @compare + sorted ->                  (' .lesser .greater ..)
  lesser, greater = {} ..                                      (detach -e list 1st others)
                                                               (.* others x >
  detach -e list 1st others                                        ([# compare] x 1st order-by >
                                                                       (attach greater x)
  for others x ->                                                  >
    if (compare x 1st order-by) -> attach greater x                    (attach lesser x)
    else attach lesser x                                           )
  ;                                                            )
                                                               ([list] >
  if list ->                                                       (attach sorted ls-sorted 1st gt-sorted -
    attach sorted ls-sorted 1st gt-sorted                              (# sort lesser compare order-by .ls-sorted
    ' ls-sorted = sort lesser compare order-by,                         # sort greater compare order-by .gt-sorted)
      gt-sorted = sort greater compare order-by                    )
  ;                                                            )
_                                                          +
  order-by : SORT_* : {ASC DESC}                               {SORT_* : {ASC DESC}} order-by
;                                                          )











