Bug in sorting code

John Leuner jewel at pixie.co.za
Wed Feb 16 06:33:40 PST 2005


Can someone please confirm this behaviour (it appears that I have to
call sortBy: twice before my list of strings is properly sorted).

Slate 17> a: {"Set" 'id'. 'inkscape:version'. 'xmlns:inkscape'.
'xmlns:sodipodi'. 'xmlns:dc'. 'xmlns:rdf'.
    'height'. 'sodipodi:docname'. 'width'. 'xmlns'. 'xmlns:cc'.
'sodipodi:version'.
    'xmlns:svg'. 'sodipodi:docbase'}.

{'id'. 'inkscape:version'. 'xmlns:inkscape'. 'xmlns:sodipodi'.
'xmlns:dc'.
    'xmlns:rdf'. 'height'. 'sodipodi:docname'. 'width'. 'xmlns'.
'xmlns:cc'. 'sodipodi:version'.
    'xmlns:svg'. 'sodipodi:docbase'}

Slate 18> a: (a sortBy: [ |:a :b | (a lexicographicallyCompare: b) <= 0]
).
{"SortedArray" 'height'. 'inkscape:version'. 'id'. 'sodipodi:version'.
'sodipodi:docbase'.
    'sodipodi:docname'. 'width'. 'xmlns'. 'xmlns:cc'. 'xmlns:dc'.
'xmlns:rdf'. 'xmlns:inkscape'.
    'xmlns:sodipodi'. 'xmlns:svg'}

Slate 19>  a: (a sortBy: [ |:a :b | (a lexicographicallyCompare: b) <=
0] ).
{"SortedArray" 'height'. 'id'. 'inkscape:version'. 'sodipodi:docbase'.
'sodipodi:docname'.
    'sodipodi:version'. 'width'. 'xmlns'. 'xmlns:cc'. 'xmlns:dc'.
'xmlns:inkscape'.
    'xmlns:rdf'. 'xmlns:sodipodi'. 'xmlns:svg'}





More information about the Slate mailing list