Statement separator: Difference between revisions

Jump to navigation Jump to search
511 bytes added ,  05:24, 11 November 2022
m (Adám Brudzewsky moved page Statement Separator to Statement separator over redirect: Naming convention)
 
Line 6: Line 6:
[[A Dictionary of APL]]<ref>[[Kenneth E. Iverson|Iverson, Kenneth]]. [https://www.jsoftware.com/papers/APLDictionary1.htm#3e "A Dictionary of APL"]. Sansom. 1987.</ref> states that "expressions using the statement separator (<syntaxhighlight lang=apl inline>⋄</syntaxhighlight>) can be mimicked by expressions using the verb '''[[left]]'''. The primary difference is that the separation imposed by <syntaxhighlight lang=apl inline>⊣</syntaxhighlight> follows the normal rules for order of execution."  
[[A Dictionary of APL]]<ref>[[Kenneth E. Iverson|Iverson, Kenneth]]. [https://www.jsoftware.com/papers/APLDictionary1.htm#3e "A Dictionary of APL"]. Sansom. 1987.</ref> states that "expressions using the statement separator (<syntaxhighlight lang=apl inline>⋄</syntaxhighlight>) can be mimicked by expressions using the verb '''[[left]]'''. The primary difference is that the separation imposed by <syntaxhighlight lang=apl inline>⊣</syntaxhighlight> follows the normal rules for order of execution."  


[[APL/700]] uses a semicolon to achieve the same effect as the left [[Identity]] function <syntaxhighlight lang=apl inline>⊣</syntaxhighlight>.
Some historical APLs used a right-to-left alternative [[glyph]] to achieve the same effect as the left [[Identity]] function (<syntaxhighlight lang=apl inline>⊣</syntaxhighlight>), as does [[J]] (<syntaxhighlight lang=j inline>[</syntaxhighlight>).
* [[APL/700]] used a semicolon (<syntaxhighlight lang=apl inline>;</syntaxhighlight>)
* [[MCM/70]] used a "null operator" [[jot]] (<syntaxhighlight lang=apl inline>∘</syntaxhighlight>)
However, and while relevant for J, but not for these historical APLs, this does not allow definition of multiple single-line functions on the same line.


[[Branch]] (<syntaxhighlight lang=apl inline>→</syntaxhighlight>) takes precedence over statement separators. "If the expression to the right of the branch is not empty, the system goes immediately to the line whose number is the first element in that expression."<ref>[[Paul Berry|Berry, Paul]]. [https://archive.org/details/sharp-apl-reference-manual_202108 "Sharp APL Reference Manual"]. [[I.P. Sharp Associates]]. 1987.</ref>
[[Branch]] (<syntaxhighlight lang=apl inline>→</syntaxhighlight>) takes precedence over statement separators. "If the expression to the right of the branch is not empty, the system goes immediately to the line whose number is the first element in that expression."<ref>[[Paul Berry|Berry, Paul]]. [https://archive.org/details/sharp-apl-reference-manual_202108 "Sharp APL Reference Manual"]. [[I.P. Sharp Associates]]. 1987.</ref> It is only possible to branch to the first statement on any line.


When displaying an errors message, where the error happened on a line containing statement separators, statements to the right of the position indicated by the error caret have not yet been executed:
When displaying an errors message, where the error happened on a line containing statement separators, statements to the right of the position indicated by the error caret have not yet been executed:

Navigation menu