Sorting a list or string

Q&A's, tips, howto's

Sorting a list or string

Postby joejoe » Wed Jul 11, 2018 9:16 am

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!
joejoe
 
Posts: 140
Joined: Thu Jun 25, 2009 5:09 pm

Re: Sorting a list or string

Postby gekkonier » Wed Jul 11, 2018 10:02 am

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 ;)
gekkonier
 
Posts: 14
Joined: Fri Jan 26, 2018 7:44 pm

Re: Sorting a list or string

Postby ralph.ronnquist » Thu Jul 12, 2018 1:25 pm

You might have meant the third line be
Code: Select all
(set 'worder (map lower-case words))
ralph.ronnquist
 
Posts: 178
Joined: Mon Jun 02, 2014 1:40 am
Location: Melbourne, Australia

Re: Sorting a list or string

Postby gekkonier » Fri Jul 13, 2018 8:46 am

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

One can only guess if you don't get any feedback.
gekkonier
 
Posts: 14
Joined: Fri Jan 26, 2018 7:44 pm

Re: Sorting a list or string

Postby joejoe » Sat Jul 14, 2018 3:14 am

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!
joejoe
 
Posts: 140
Joined: Thu Jun 25, 2009 5:09 pm


Return to newLISP in the real world

Who is online

Users browsing this forum: No registered users and 3 guests

cron