Re: [Bug-apl] Revisiting the APL 2 empty-array display behavior

2014-05-31 Thread Juergen Sauermann
Hi Jay, as the GNU APL info manual says: /GNU APL supports direct functions (aka. lambdas), but only in a rather// //limited form./ No plan to change this. /// Jürgen On 05/29/2014 04:44 PM, Jay Foad wrote: On 29 May 2014 15:28, Juergen Sauermann > wrote

Re: [Bug-apl] Revisiting the APL 2 empty-array display behavior

2014-05-31 Thread Juergen Sauermann
Hi, I believe the dyadic ⍕ with character left argument (called *Format by Example* in IBM APL2) is more powerful than ⎕FMT (which is a bit too FORTRAN-like for my taste) and is already implemented in GNU APL. And then we have good old printf() in FILE_IO. /// Jürgen On 05/29/2014 04:33 PM

Re: [Bug-apl] Revisiting the APL 2 empty-array display behavior

2014-05-29 Thread Jay Foad
On 29 May 2014 15:28, Juergen Sauermann wrote: > The method for discarding a value *Z *seems to be *0 0⍴**Z* instead > of *0⍴Z* these days. A smarter one could be monadic ⍪ ("table") > which turns an empty vector into an empty matrix (as does *0 0⍴*). > In Dyalog APL you can also use an empty d

Re: [Bug-apl] Revisiting the APL 2 empty-array display behavior

2014-05-29 Thread Elias Mårtenson
Would it make sense to implement Dyalog's ⎕FMT function? It should actually be possible to mostly implement it in pure APL. Or, we could implement something better (i.e. easier to use). It's definitely something that would be useful in a generic library. Regards, Elias On 29 May 2014 22:28, Juer

Re: [Bug-apl] Revisiting the APL 2 empty-array display behavior

2014-05-29 Thread Juergen Sauermann
Hi, output formatting is one of the most challenging tasks in an APL2 interpreter. The rules governing this are spread over different chapter in the APL2 language reference and seem to be different in the ISO standard. Even the examples in the language reference and in the standard differ occasio

Re: [Bug-apl] Revisiting the APL 2 empty-array display behavior

2014-05-28 Thread David B. Lamkins
On Wed, 2014-05-28 at 18:11 -0500, Blake McBride wrote: > Dear David, > > > Thanks for the idiom reference! > You're welcome. :) > > With a lot of respect, I think you missed my point. The APL 1 idiom > works as you want and expect in APL 1, APL 2, and GNU APL. Look > closely at my example.

Re: [Bug-apl] Revisiting the APL 2 empty-array display behavior

2014-05-28 Thread Blake McBride
Dear David, Thanks for the idiom reference! With a lot of respect, I think you missed my point. The APL 1 idiom works as you want and expect in APL 1, APL 2, and GNU APL. Look closely at my example. On the other hand, if it is I who is missing the point (quite possible), please explain. Thank

Re: [Bug-apl] Revisiting the APL 2 empty-array display behavior

2014-05-28 Thread David B. Lamkins
Yes, it is interesting. I now understand that ⍎BS/'expr' is an APL 1 idiom that became obsolete with APL 2. The APL 2 IDIOMS Library[*] offers this instead: fn¨BS/⊂A ⍝ Conditional execution of monadic function. As-is, this is not as general as APL 1's ⍎BS/'expr', but it's still useful. With a h

Re: [Bug-apl] Revisiting the APL 2 empty-array display behavior

2014-05-28 Thread Blake McBride
Dear David, Interesting observation. More interesting is how GNU APL correctly handles it. i.e.: ∇test[⎕]∇ ∇ [0] test [1] '1' [2] ⍎0/'test2' [3] '2' [4] '' [5] '3' [6] ⍎1/'test2' [7] '4' ∇ ∇test2[⎕]∇ ∇ [0] test2 [1] 'test2' ∇ test 1 2 3 tes