Ordering by size first makes very little sense to me. It makes it very hard
to sort any list of strings.

I was hoping that the following would have done so, but it also suffers
from the "length first" issue:

      *z[⍋ ⎕UCS¨ z←'aa' 'xx' 'aaa' 'xxx']*
 aa xx aaa xxx

What is the proper way to sort strings given the existing semantics of
grade?

Regards,
Elias


On 8 July 2014 02:34, David Lamkins <da...@lamkins.net> wrote:

> Looking at the spec, it seems that monadic grade is defined only for
> numeric data.
>
> That leaves open the question of whether my example should have signaled a
> domain error.
>
>
> On Mon, Jul 7, 2014 at 11:25 AM, David Lamkins <da...@lamkins.net> wrote:
>
>> Given a list of character vectors (and scalars), grade appears to
>> generate the permutation vector first by length then by content.
>>
>>       ⍋'aaa' 'xx' 'y' 'bbb' 'cc'
>> 3 5 2 1 4
>>
>> This seems counterintuitive. It seems as if ⍋ treats character strings
>> like numbers. Is this a bug?
>>
>> --
>> "The secret to creativity is knowing how to hide your sources."
>>    Albert Einstein
>>
>>
>> http://soundcloud.com/davidlamkins
>> http://reverbnation.com/lamkins
>> http://reverbnation.com/lcw
>> http://lamkins-guitar.com/
>> http://lamkins.net/
>> http://successful-lisp.com/
>>
>
>
>
> --
> "The secret to creativity is knowing how to hide your sources."
>    Albert Einstein
>
>
> http://soundcloud.com/davidlamkins
> http://reverbnation.com/lamkins
> http://reverbnation.com/lcw
> http://lamkins-guitar.com/
> http://lamkins.net/
> http://successful-lisp.com/
>

Reply via email to