String comparison function

3 views
Skip to first unread message

Paolo Amoroso

unread,
Apr 20, 2023, 2:00:38 PM4/20/23
to Medley Interlisp Users/Interest
What comparison function can I pass to SORT as its second argument to sort a list of strings in descending alphabetic order? I reviewed the strings chapter of IRM but was unable to find the equivalent for strings of, say, GREATERP.


Paolo
--

Nick Briggs

unread,
Apr 20, 2023, 2:08:12 PM4/20/23
to Paolo Amoroso, Medley Interlisp Users/Interest
ALPHORDER help you.  Then reverse the list.



--
https://Interlisp.org for more details
---
You received this message because you are subscribed to the Google Groups "Medley Interlisp Users/Interest" group.
To unsubscribe from this group and stop receiving emails from it, send an email to interlisp+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/interlisp/CAGi1hzvybW%2BsHXQ%3D57SiffoeYWvdvQgE5e0w3YwOGy%2BcdAzdOQ%40mail.gmail.com.

Nick Briggs

unread,
Apr 20, 2023, 3:00:13 PM4/20/23
to Paolo Amoroso, Medley Interlisp Users/Interest
[so these are also in the replies for everyone to see] 

Or…

(SORT MYLIST #’(LAMBDA (X Y) (ALPHORDER Y X)))

and note that from the DINFO documentation for SORT:  if the SORT compare function is NIL it uses ALPHORDER by default and so will produce a list in normal alphabetic order.

— Nick


On Apr 20, 2023, at 11:00 AM, Paolo Amoroso <paolo....@gmail.com> wrote:

Reply all
Reply to author
Forward
0 new messages