|
From: | Juergen Sauermann |
Subject: | Re: [Bug-apl] A couple of bugs, and a question on the power operator |
Date: | Sat, 13 Aug 2016 16:19:19 +0200 |
User-agent: | Mozilla/5.0 (X11; Linux i686; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 |
Hi, the problem is that there is no syntactical means to "state otherwise". I personally find it convenient to assign to variables outside the lambda, for example to increment a counter on every iteration of the lambda. Of course one can criticize the way APL handles variables, but the limited number of function arguments and return values makes the scoping rules of APL almost inevitable. And I still believe that it is a bad thing if the scoping rules of lambdas are different from the scoping rules of "normal" defined functions. So the only room for changes that remains is to have a way of adding local variables to the header line of lambdas. Something along the lines of: FUN←'A B C' ⎕LOCALIZE { ... } where A B and C would become local variables in the named lambda FUN. I would also argue that lambdas are only a quick-and-dirty hack for specifying the function arguments of the EACH operator and friends; for serious functions ⎕FX and ∇ have all the features that are missing in GNU APL lambdas. /// Jürgen On 08/13/2016 02:11 PM, Elias Mårtenson
wrote:
|
[Prev in Thread] | Current Thread | [Next in Thread] |