Statement separator: Difference between revisions

From APL Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 1: Line 1:
Statement Separator (<syntaxhighlight lang=apl inline>⋄</syntaxhighlight>) often called by the name of its glyph Diamond, allows you to place multiple statements on a single line. It works both inside a function and directly within the interpreter.  
Statement Separator (<syntaxhighlight lang=apl inline>⋄</syntaxhighlight>) often called by the name of its glyph Diamond, allows you to place multiple statements on a single line. It works both inside a function and directly within the interpreter. Statement separators can be empty.


It is important to note that using a Statement Separator(<syntaxhighlight lang=apl inline>⋄</syntaxhighlight>) forces the interpreter to read from left to right. Each separated statement will be read as if it is on it's own line.  
It is important to note that using a Statement Separator(<syntaxhighlight lang=apl inline>⋄</syntaxhighlight>) forces the interpreter to read from left to right. Each separated statement will be read as if it is on it's own line.  


When tracing errors within a line containing diamonds, statements to the right of the caret have not yet been executed.
In Iverson's Dictionary of APL [https://www.jsoftware.com/papers/APLDictionary1.htm#3e] he states "expressions using the statement separator (<syntaxhighlight lang=apl inline>⋄</syntaxhighlight>) can be mimicked by expressions using the verb left [[Identity]]. The primary difference is that the separation imposed by <syntaxhighlight lang=apl inline>⊣</syntaxhighlight> follows the normal rules for order of execution."


In Iverson's Dictionary of APL [https://www.jsoftware.com/papers/APLDictionary1.htm#3e] he states "expressions using the statement separator (<syntaxhighlight lang=apl inline>⋄</syntaxhighlight>) can be mimicked by expressions using the verb left [[Identity]]. 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 tack (<syntaxhighlight lang=apl inline>⊣</syntaxhighlight>).
[[APL/700]] uses a semicolon to achieve the same effect as the left tack (<syntaxhighlight lang=apl inline>⊣</syntaxhighlight>).
 
According to the Sharp APL [https://archive.org/details/sharp-apl-reference-manual_202108] Reference [[branching]] takes precedence over statement separators. ie "If the expression to the right of is not empty, the system goes immediately to the line whose number is the first element in that expression"
 
When tracing errors within a line containing diamonds, statements to the right of the caret have not yet been executed.
 
Statement separators to the right of a comment are ignored.  


=== Documentation ===
=== Documentation ===
Line 12: Line 18:
* Nars2000: [http://wiki.nars2000.org/index.php?title=Diamond]
* Nars2000: [http://wiki.nars2000.org/index.php?title=Diamond]
* BQN: [https://mlochbaum.github.io/BQN/doc/token.html#separators]
* BQN: [https://mlochbaum.github.io/BQN/doc/token.html#separators]
* Sharp: [https://archive.org/details/sharp-apl-reference-manual_202108]
* Dictionary of APL: [https://www.jsoftware.com/papers/APLDictionary1.htm#3e"]

Revision as of 22:03, 10 November 2022

Statement Separator () often called by the name of its glyph Diamond, allows you to place multiple statements on a single line. It works both inside a function and directly within the interpreter. Statement separators can be empty.

It is important to note that using a Statement Separator() forces the interpreter to read from left to right. Each separated statement will be read as if it is on it's own line.

In Iverson's Dictionary of APL [1] he states "expressions using the statement separator () can be mimicked by expressions using the verb left Identity. The primary difference is that the separation imposed by follows the normal rules for order of execution."

APL/700 uses a semicolon to achieve the same effect as the left tack ().

According to the Sharp APL [2] Reference branching takes precedence over statement separators. ie "If the expression to the right of is not empty, the system goes immediately to the line whose number is the first element in that expression"

When tracing errors within a line containing diamonds, statements to the right of the caret have not yet been executed.

Statement separators to the right of a comment are ignored.

Documentation