|
From: | Juergen Sauermann |
Subject: | Re: [Bug-apl] Performance problems when constructing large(ish) arrays |
Date: | Wed, 18 Jan 2017 00:01:24 +0100 |
User-agent: | Mozilla/5.0 (X11; Linux i686; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 |
Hi Elias, I believe in principle what we want is something like this: Z←FOO¨Z←⎕FIO[N] 'filename' where ⎕FIO[N] reads 'filename' line by line putting each line j into the nested item Z[j] and FOO is a decoding function that translates a line into whatever Z[j] shall become in the end. The current performance problem is then solved by the ¨ operator which allocates a big enough Z beforehand and fills it with the result of FOO for each line. I can try to make ⎕FIO an operator so that you can use Z←FOO ⎕FIO[N] 'filename' for the above and I hope that will be syntactically possible. But it looks almost like +/[N]B with FOO instead of + and ⎕FIO instead of / which I believe should work somehow. Can become a little tricky though, because there are the same ambiguities for ⎕FIO then those for / (function versus operator). /// Jürgen On 01/17/2017 09:37 PM, Elias Mårtenson
wrote:
|
[Prev in Thread] | Current Thread | [Next in Thread] |