On Sunday, November 26, 2023 at 2:42:34 AM UTC-5, Rosario19 wrote:
> In the page of internet of "rosetta code", there is one APL function
> qsort
> but here in Nars2000 there is some problem
>
> qsort {leftarrow}
> {leftbrace}1{rightcaretunderbar}r{leftarrow}{notequalunderbar}{omega}:{omega}{diamond}p{leftarrow}{omega}[?r]{diamond}({del}({omega}<p)/{omega}),(({omega}=p)/{omega}),({del}({omega}>p)/{omega}){rightbrace}
>
> qsort 45 7 88 55 4 6 89
> LIMIT ERROR
So sorry, you found a bug in NARS2000 which I've fixed in the beta version:
https://www.nars2000.org/download/binaries/beta/. Please try running your qsort function again on the beta version.
> My workaround is not write ?r but use floor(r/2) instead. Than added
> some code for use one extern compare function for 2 elements
>
> qsortf{leftarrow}{leftbrace}1{rightcaretunderbar}r{leftarrow}{notequalunderbar}{omega}:{omega}{diamond}p{leftarrow}{omega}{rightshoe}{dieresistilde}{downstile}r{colonbar}2{diamond}k{leftarrow}{alpha}{alpha}{leftbrace}{omega}{alpha}{alpha}p{rightbrace}{dieresis}{omega}{diamond}({alpha}{alpha}{del}{del}(0<k)/{omega}),((0=k)/{omega}),({alpha}{alpha}{del}{del}(0>k)/{omega}){rightbrace}
>
> This order using function -
> -qsortf 45 7 88 55 4 6 89
> +7-----------------+
> Ś 89 88 55 45 7 6 4Ś
> +~-----------------+
> this use the function -{dieresistilde} (im not so sure {dieresistilde}
> is the right traslation)
> -{dieresistilde}qsortf 45 7 88 55 4 6 89
> +7-----------------+
> Ś 4 6 7 45 55 88 89Ś
> +~-----------------+
> this order using the first element of array element
> {?[1]<?[1]:Ż1??[1]=?[1]:0?1} qsortf (45 2) (7 9) (88 1) (55 3)
> (4 5) (6 11) (89 8)
> +7----------------------------------------------------+
> Ś+2----+ +2----+ +2----+ +2----+ +2---+ +2----+ +2---+Ś
> ŚŚ 89 8Ś Ś 88 1Ś Ś 55 3Ś Ś 45 2Ś Ś 7 9Ś Ś 6 11Ś Ś 4 5ŚŚ
> Ś+~----+ +~----+ +~----+ +~----+ +~---+ +~----+ +~---+2
> +?----------------------------------------------------+
>
> someone note something wrong? is there some error (because i'm not
> familiar in use function {alpha}{alpha} or {del}{del} )?
I'm not sure what you are expecting. Does the output look incorrect?
Also, it would be *so much easier* for me to help you if you were to use actual APL characters in your messages. To do this, copy the APL code from your NARS2000 session and paste it into your message, along with the boxed output. There may be other settings to change such as use an APL font, and UTF-8 encoding, but let's try just copying APL code first. Please, please do this.