sorting - How to sort by key AND value in SICStus Prolog? -


i have list like

l = [0-4, 0-3, 3-5, 1-2] 

and sort list key , value result be

l = [0-3, 0-4, 1-2, 3-5] 

i found keysort sorts key. can write sort myself need efficient solution.

call sort/2 (or msort/2 if want keep duplicates)

?- sort([0-4, 0-3, 3-5, 1-2], s). s = [0-3, 0-4, 1-2, 3-5]. 

Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Socket.connect doesn't throw exception in Android -

iphone - How do I keep MDScrollView from truncating my row headers and making my cells look bad? -