Content deleted Content added
→Dfns versus tradfns: sieve is code |
→History: ⍺ and ⍵; removed parenthetical remark about dynamic local |
||
Line 451:
name : expression0 : proposition : expression1
</source>
Within a direct definition, {{code|⍺|apl}} denotes the left argument and {{code|⍵|apl}} the right argument. In the first instance, the result of {{code|expression|apl}} is the result of the function; in the second instance, the result of the function is that of {{code|expression0|apl}} if {{code|proposition|apl}} evaluates to 0, or {{code|expression1|apl}} if it evaluates to 1. Assignments within a direct definition are [[Scope (computer science)#Dynamic scoping|dynamically local]]
Direct definition was too limited for use in larger systems. The ideas were further developed by multiple authors in multiple works<ref name=opfns>{{citation|last=Iverson|first=Kenneth E.|title=Operators and Functions|journal=Research Report Number #RC7091|date=26 April 1978|publisher=IBM Corporation|url=http://www.jsoftware.com/papers/opfns.htm|access-date=2019-09-19}}</ref>{{rp|§8}}<ref name=IversonWooster1981>{{citation journal|last1=Iverson|first1=Kenneth E.|last2=Wooster|first2=Peter|title=A Function Definition Operator|journal=APL81 Conference Proceedings, APL Quote Quad|volume=12|number=1|date=September 1981}}</ref><ref name=Cheney>{{citation|last=Cheney|first=Carl M.|title=APL*Plus Nested Array System Reference Manual|date=March 1981|publisher=STSC, Inc.|url=http://www.sudleyplace.com/APL/Nested%20Arrays%20System.pdf|access-date=18 September 2019}}</ref>{{rp|§4.17}}<ref name=ratapl>{{citation|last=Iverson|first=Kenneth E.|title=Rationalized APL|date=6 January 1983|publisher=I.P. Sharp Associates|url=http://www.jsoftware.com/papers/RationalizedAPL.htm|access-date=2019-09-19}}</ref><ref name=dictionary>{{citation journal|last=Iverson|first=Kenneth E.|title=A Dictionary of APL|journal=APL Quote Quad|volume=18|number=1|date=September 1987|url=http://www.jsoftware.com/papers/APLDictionary.htm|access-date=19 September 2019}}</ref><ref name=Bunda1987>{{citation journal|last=Bunda|first=John|title=APL Function Definition Notation|journal=APL87 Conference Proceedings, APL Quote Quad|volume=17|number=4|date=May 1987}}</ref><ref name=J>{{citation journal|last1=Hui|first1=Roger|display-authors=etal|title=APL\?|journal=APL90 Conference Proceedings, APL Quote Quad|volume=20|number=4|date=July 1990|url=http://www.jsoftware.com/papers/J1990.htm|access-date=2019-09-10}}</ref> but the results were unwieldy. Of these, the "alternative APL function definition" of Bunda in 1987<ref name=Bunda1987/> came closest to current facilities, but is flawed in conflicts with existing symbols and in error handling which would have caused practical difficulties, and was never implemented. The main distillates from the different proposals were that (a) the function being defined is anonymous, with subsequent naming (if required) being effected by assignment; (b) the function is denoted by a symbol and thereby enables [[anonymous recursion]].<ref name=APL1978/>
|