Re: [Bug-apl] Non-bug: Help comparing solutions

2014-03-04 Thread Elias Mårtenson
Referencing yesterday's discussion about ⍤, I realised that I can use it to get the indexes like this: *X* ┌→─┐ ↓xz│ │zx│ │ab│ │ba│ └──┘ *⍋⍤1 X* ┌→──┐ ↓1 2│ │2 1│ │1 2│ │2 1│ └───┘ However, I can't figure out a good way to apply it to the original array. Really, what is th ebest solu

[Bug-apl] Non-bug: Help comparing solutions

2014-03-04 Thread Elias Mårtenson
I was looking at the APL idiom libraryand found this solution to sort rows in a matrix X: A←(⍋,X)-⎕IO ◊ (⍴X)⍴(,X)[⎕IO+A[⍋⌊A÷¯1↑⍴X]] It looked a bit excessive to me, and I wanted to make a more clear version so I came up with this: ⊃p⌷¨⍨⊂¨⍋¨p←⊂[2]X Are t

Re: [Bug-apl] Rank operator and function assignment

2014-03-04 Thread Kacper Gutowski
On 2014-03-04 18:53:29, Juergen Sauermann wrote: > They say that f ⍤y is a function which is then called with arguments B and > possibly A. > Thus Z is a value and not a function; the function is created internally. I guess the problem is that GNU APL doesn't really have what most people understan

Re: [Bug-apl] Rank operator and function assignment

2014-03-04 Thread Daniel H. Leidisch
Hello! Juergen Sauermann writes: > What you probably intended to do is: > > * {'foo',⍵}⍤1 (4 5⍴⍳10)* > foo 1 2 3 4 5 > foo 6 7 8 9 10 > foo 1 2 3 4 5 > foo 6 7 8 9 10 Shouldn't this work, too? ({'foo',⍵}⍤1) 4 5⍴⍳10 RANK ERROR (λ1⍤1)4 5⍴⍳10 ^^ Works in NARS200

Re: [Bug-apl] Possible improvement to ]BOXING

2014-03-04 Thread Juergen Sauermann
Hi Elias, I believe it would be more confusing if ⎕CR is sometimes computed and sometimes not. The example below might be easy to detect but what about cases like Z←8 ⎕CR xxx ◊ Z or some ⎕CR returned by a function? /// Jürgen On 03/04/2014 05:35 AM, Elias Mårtenson wrote: I love ]BOXING a

Re: [Bug-apl] Rank operator and function assignment

2014-03-04 Thread Juergen Sauermann
Hi Elias, I assume by spec you mean ISO/IEC 13751. They give the following syntax: Z ← f ⍤y B (deriving monadically) and Z ← A f ⍤y B (deriving dyadically). They say that f ⍤y is a function which is then called with arguments B and possibly A. Thus Z is a value and not a function; the functi

Re: [Bug-apl] )COPY and )PCOPY

2014-03-04 Thread Juergen Sauermann
Hi, true. fixed in SVN 154. /// Jürgen On 03/03/2014 07:32 PM, David B. Lamkins wrote: )COPY and )PCOPY should not change wsid.

Re: [Bug-apl] Missing Doxyfile

2014-03-04 Thread Juergen Sauermann
Hi, thanks, added in SVN 154. /// Jürgen On 03/04/2014 05:46 AM, David B. Lamkins wrote: The doxygen tool used by the DOXY make target looks for a configuration file name Doxyfile. The attached Doxyfile retains all defaults except for INPUT = . src SOURCE_BROWSER = YES which is the minimum

Re: [Bug-apl] Should a native function be expungeable?

2014-03-04 Thread Juergen Sauermann
Hi, thanks, fixed in SVN 154. /// Jürgen On 03/04/2014 01:26 AM, David B. Lamkins wrote: Once one defines a native function, should the function be expungeable? Attempting to )erase the function fails silently; applying ⎕ex to the native function's name causes a crash.

[Bug-apl] Rank operator and function assignment

2014-03-04 Thread Elias Mårtenson
I was playing around with the Rank Operator, which is something that isn't really documented in many places. I only saw references to it in the spec, while neither APL2 nor Dyalog mentions it. Now, there are a few things that behaves strangely, although it may be correct. First of all, the follow