Hi Elias, thaks. The explanation is a bit clearer but the problems remain. Key is a non-standard APL function and we should be careful with the implementation of non-standard functions. Every function in GNU APL is an invitation to use it. If the function is obviously useful then it improves the language. If it merely solves a particular programming case, then it may improve GNU APL a little, but at the price of incompatibility. Programs using it become less portable and that undermines the goal of free software. So the question in such cases is how useful is a function and is that usefulness worth the incompatibility? In the case of the key function I would say no. First of all the key function can only be used if the data it operates on is organized in a specific way: that the first column is the key. That may be the case but the fact that this is needed is somewhat contrary to how other APL function work. You could also call that arbitrary. That goal can easily achieved by other means. If I have a single KEY then something along the lines of ((DATA[1;]≡KEY)⌿KEY)[1;] will give me the first row (or all rows if I remove the right [1;]) in an array that has that KEY. I suppose that is more or less what the key function does (plus applying some function on that _expression_). The _expression_ is even superior to a function because it can be used at the left side of an assignment. If that is so then the key function is only one of several APL idioms (see http://aplwiki.com/FinnAplIdiomLibrary for a rather famous list of more than 700 such idioms). Each of the 700+ idioms is useful and would deserver its own symbol, but if we would do so (which is technically possible due to Unicode) then we would have turned GNU APL into an unreadable mess. Best Regards, Jürgen Sauermann On 07/03/2017 05:50 AM, Elias Mårtenson
wrote:
|
- [Bug-apl] Implementing Dyalog Key function Elias Mårtenson
- Re: [Bug-apl] Implementing Dyalog Key function Juergen Sauermann
- Re: [Bug-apl] Implementing Dyalog Key function Elias Mårtenson
- Re: [Bug-apl] Implementing Dyalog Key funct... Juergen Sauermann
- Re: [Bug-apl] Implementing Dyalog Key f... Elias Mårtenson
- Re: [Bug-apl] Implementing Dyalog ... Juergen Sauermann
- Re: [Bug-apl] Implementing Dya... Elias Mårtenson
- Re: [Bug-apl] Implementing... Blake McBride
- Re: [Bug-apl] Implementing... Elias Mårtenson
- Re: [Bug-apl] Implementing... Blake McBride
- Re: [Bug-apl] Implementing... Elias Mårtenson
- Re: [Bug-apl] Implementing... Juergen Sauermann
- Re: [Bug-apl] Implementing... Louis de Forcrand
- Re: [Bug-apl] Implementing... Elias Mårtenson