Sorting a list or string

Q&A's, tips, howto's
Post Reply
joejoe
Posts: 158
Joined: Thu Jun 25, 2009 5:09 pm
Location: Denver, USA

Sorting a list or string

Post by joejoe »

Hi and thanks!

Code: Select all

(set 'word (join titles " "))
(set 'words (find-all {\w{5,}} word))
(set 'worder (lower-case (string words)))
(println (sort worder))

ERR: list or array expected in function sort : worder
worder looks similar to this: ("one" "two" "three")

How would I best sort this?

Thanks very much for help!

gekkonier
Posts: 14
Joined: Fri Jan 26, 2018 7:44 pm

Re: Sorting a list or string

Post by gekkonier »

Hello!
Please provide a valid content for the symbol titles, and what output you expect from that given data.
Your code does not work at all ;)

ralph.ronnquist
Posts: 216
Joined: Mon Jun 02, 2014 1:40 am
Location: Melbourne, Australia

Re: Sorting a list or string

Post by ralph.ronnquist »

You might have meant the third line be

Code: Select all

(set 'worder (map lower-case words))

gekkonier
Posts: 14
Joined: Fri Jan 26, 2018 7:44 pm

Re: Sorting a list or string

Post by gekkonier »

It's kind of tedious. I hope everything is alright with joejoe...
;)

One can only guess if you don't get any feedback.

joejoe
Posts: 158
Joined: Thu Jun 25, 2009 5:09 pm
Location: Denver, USA

Re: Sorting a list or string

Post by joejoe »

ralph.ronnquist wrote:You might have meant the third line be

Code: Select all

(set 'worder (map lower-case words))
Ralph, you always bat cleanup around here. Thank you!

It's hard to admit you know what I want to do before I even thought to do it! ;0)

Thanks for this very much and learned going forward. Big thanks for this and all many past!

Post Reply