Jump to content

Sort list - get indexes


Recommended Posts

Posted

I want to sort a list.  I'm not interested in getting back a list of the sorted values, I want a list of the indexes.

 

For example:

(getSortedIndexes (list "b" "a" "e" "f" "c") ) should return (list 1 0 4 2 3)

 

I feel like I asked this question before, but I can't find it

Posted

Oh yes, thanks.

 

(vl-sort-i (list  "b" "a" "e" "f" "c") '<) returns (list 1 0 4 2 3) .

 

 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...