Hi -

I think you're probably right about the J solution missing the point of the
problem.

However, as is common in these sort of comparisons, the problem also misses
the point of J.  The advantage J brings is not in slavishly duplicating ways
that other languages work but in adding new perspective.  In this case, the
problem misses out on the tremendous advantage of grading versus sorting.

I'm working on an exposition of these advantages and would welcome any
examples people can come up with.

Devon

On 3/13/08, June Kim <[EMAIL PROTECTED]> wrote:
>
> Hello,
>
> Look at the J code at
> http://www.rosettacode.org/wiki/Sorting_Using_a_Custom_Comparator#J
>
> I think it misses the point of the problem. It asks to show the
> sorting facility of a programming language using a custom comparator,
> that is a tailored sorting facility. The variability should be
> pluggable. Look at the other solutions.
>
> The J solution given doesn't show that a flexible and pluggable
> sorting facility.
>
> For example, I think the following code is aimed closer to the point
> of the problem:
>    load 'strings'
>    sortby=: 1 : '] \: u&.>'
>    (# ,[:-[: a.&i. tolower) sortby strings
>
> I am not sure if mine is a good J-ic approach. I'd be happy to see
> more J-ic way of doing it. Thanks.
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
>



-- 
Devon McCormick, CFA
^me^ at acm.
org is my
preferred e-mail
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to