APL/700: Difference between revisions

Jump to navigation Jump to search
900 bytes added ,  21:20, 10 September 2022
m
Text replacement - "</source>" to "</syntaxhighlight>"
mNo edit summary
m (Text replacement - "</source>" to "</syntaxhighlight>")
(One intermediate revision by the same user not shown)
Line 20: Line 20:
== Unique features ==
== Unique features ==
Despite its similarity However, it also differed in quite a few details:<ref>[[wikipedia:Burroughs Corporation|Burroughs Corporation]]. [http://www.softwarepreservation.org/projects/apl/Manuals/APL700UserReferenceManual User Reference Manual] (5000813). 1975.</ref>
Despite its similarity However, it also differed in quite a few details:<ref>[[wikipedia:Burroughs Corporation|Burroughs Corporation]]. [http://www.softwarepreservation.org/projects/apl/Manuals/APL700UserReferenceManual User Reference Manual] (5000813). 1975.</ref>
* The statement separator was a semicolon (<source lang=apl inline>;</source>) rather than the conventional diamond <source lang=apl inline>⋄</source> and statements in such a so-called ''list'' were evaluated from right to left, much as if the semicolon was the Left [[identity]] function (<source lang=apl inline>⊣</source>).
* The statement separator was a semicolon (<syntaxhighlight lang=apl inline>;</syntaxhighlight>) rather than the conventional diamond <syntaxhighlight lang=apl inline>⋄</syntaxhighlight> and statements in such a so-called ''list'' were evaluated from right to left, much as if the semicolon was the Left [[identity]] function (<syntaxhighlight lang=apl inline>⊣</syntaxhighlight>).
* In primitive pairs with both a last and first [[axis]] version, for example <source lang=apl inline>/</source> vs <source lang=apl inline>⌿</source> and <source lang=apl inline>⌽</source> vs <source lang=apl inline>⊖</source>, the first axis version would use the [[function axis]] syntax to indicate the applicable axis counted from the ''last'' axis rather than from the first axis. For example <source lang=apl inline>⊖[1]</source> was equivalent to <source lang=apl inline>⌽</source> just like <source lang=apl inline>⌽[1]</source> was equivalent to <source lang=apl inline>⊖</source>.
* In primitive pairs with both a last and first [[axis]] version, for example <syntaxhighlight lang=apl inline>/</syntaxhighlight> vs <syntaxhighlight lang=apl inline>⌿</syntaxhighlight> and <syntaxhighlight lang=apl inline>⌽</syntaxhighlight> vs <syntaxhighlight lang=apl inline>⊖</syntaxhighlight>, the first axis version would use the [[function axis]] syntax to indicate the applicable axis counted from the ''last'' axis rather than from the first axis. For example <syntaxhighlight lang=apl inline>⊖[1]</syntaxhighlight> was equivalent to <syntaxhighlight lang=apl inline>⌽</syntaxhighlight> just like <syntaxhighlight lang=apl inline>⌽[1]</syntaxhighlight> was equivalent to <syntaxhighlight lang=apl inline>⊖</syntaxhighlight>.
* While in general reduction using scalar functions were supported by for arrays of a compatible data type (numeric or character), <source lang=apl inline>=/</source> and <source lang=apl inline>≠/</source> did not support character data.
* While in general reduction using scalar functions were supported by for arrays of a compatible data type (numeric or character), <syntaxhighlight lang=apl inline>=/</syntaxhighlight> and <syntaxhighlight lang=apl inline>≠/</syntaxhighlight> did not support character data.
* APL/700 included [[modified assignment]], but the pass-through value was the new value of the updated array.
* APL/700 included [[modified assignment]], but the pass-through value was the new value of the updated array.
* More [[set functions]] were included than even modern APLs have. In particular <source lang=apl inline>⊂</source> and <source lang=apl inline>⊂</source> were Subset and Superset, though not strict subset and superset, but rather as <source lang=apl inline>{∧/(,⍺)∊(,⍵)}</source> and <source lang=apl inline>{∧/(,⍵)∊(,⍺)}</source>. All the set functions except for Membership were defined in terms of the [[ravel]] of the arguments, and thus always returned a [[vector]]. Furthermore, [[Union]] (<source lang=apl inline>∪</source>), [[Intersection]] (<source lang=apl inline>∩</source>), and [[Set difference]] (<source lang=apl inline>~</source>) returned only [[Unique]] elements, that is, a vector with no duplicates.  
* More [[set functions]] were included than even modern APLs have. In particular <syntaxhighlight lang=apl inline>⊂</syntaxhighlight> and <syntaxhighlight lang=apl inline>⊂</syntaxhighlight> were Subset and Superset, though not strict subset and superset, but rather as <syntaxhighlight lang=apl inline>{∧/(,⍺)∊(,⍵)}</syntaxhighlight> and <syntaxhighlight lang=apl inline>{∧/(,⍵)∊(,⍺)}</syntaxhighlight>. All the set functions except for Membership were defined in terms of the [[ravel]] of the arguments, and thus always returned a [[vector]]. Furthermore, [[Union]] (<syntaxhighlight lang=apl inline>∪</syntaxhighlight>), [[Intersection]] (<syntaxhighlight lang=apl inline>∩</syntaxhighlight>), and [[Set difference]] (<syntaxhighlight lang=apl inline>~</syntaxhighlight>) returned only [[Unique]] elements, that is, a vector with no duplicates.  
* Format <source lang=apl inline>⍕</source> allowed an advanced formatting specification through a character left argument.
* Format <syntaxhighlight lang=apl inline>⍕</syntaxhighlight> allowed an advanced formatting specification through a character left argument.
* Many additional [[quad name]]s were available, including a set of two-letter system functions with all the combinations of S/R/Q (for Stop, Reset, Query) with T/S/M (Trace, Stop, Monitor), and character constants for control characters (<source lang=apl inline>⎕B</source>, <source lang=apl inline>⎕L</source>, <source lang=apl inline>⎕R</source>, <source lang=apl inline>⎕T</source>, and <source lang=apl inline>⎕N</source> for Backspace, Linefeed, Return, Tab, and Null), the [[digits]] <source lang=apl inline>⎕D</source>, and the [[alphabet]] (<source lang=apl inline>⎕A</source>).
* Many additional [[quad name]]s were available, including a set of two-letter system functions with all the combinations of S/R/Q (for Stop, Reset, Query) with T/S/M (Trace, Stop, Monitor), and character constants for control characters (<syntaxhighlight lang=apl inline>⎕B</syntaxhighlight>, <syntaxhighlight lang=apl inline>⎕L</syntaxhighlight>, <syntaxhighlight lang=apl inline>⎕R</syntaxhighlight>, <syntaxhighlight lang=apl inline>⎕T</syntaxhighlight>, and <syntaxhighlight lang=apl inline>⎕N</syntaxhighlight> for Backspace, Linefeed, Return, Tab, and Null), the [[digits]] <syntaxhighlight lang=apl inline>⎕D</syntaxhighlight>, and the [[alphabet]] (<syntaxhighlight lang=apl inline>⎕A</syntaxhighlight>).
* In a manner similar to, but more extensively than the much later [[APLX]], APL/700 had [[primitive function]]s for file operations. In addition to <source lang=apl inline>⍇</source> and <source lang=apl inline>⍈</source> for read and write operations (as in APLX), it supported the following:
* In a manner similar to, but more extensively than the much later [[APLX]], APL/700 had [[primitive function]]s for file operations. In addition to <syntaxhighlight lang=apl inline>⍇</syntaxhighlight> and <syntaxhighlight lang=apl inline>⍈</syntaxhighlight> for read and write operations (as in APLX), it supported the following:
** <source lang=apl inline>⍍</source> to create, rename and change password for files, and <source lang=apl inline>⍔</source> for deleting files.
** <syntaxhighlight lang=apl inline>⍍</syntaxhighlight> to create, rename and change password for files, and <syntaxhighlight lang=apl inline>⍔</syntaxhighlight> for deleting files.
** <source lang=apl inline>⍃</source> and <source lang=apl inline>⍄</source> were used to read+pop and append components to the beginning and end of a file, respectively.
** <syntaxhighlight lang=apl inline>⍃</syntaxhighlight> and <syntaxhighlight lang=apl inline>⍄</syntaxhighlight> were used to read+pop and append components to the beginning and end of a file, respectively.
** Equivalents of normal primitive functions for operations on component of files as if they were elements of a vectors: <source lang=apl inline>⍐</source> and <source lang=apl inline>⍗</source> acted like [[Take]] and [[Drop]] (<source lang=apl inline>↑</source> and <source lang=apl inline>↓</source>). <source lang=apl inline>⌼</source> would [[Reverse]] and [[Rotate]] (<source lang=apl inline>⌽</source>). <source lang=apl inline>⍁</source> and <source lang=apl inline>⍂</source> were [[Compress]] and [[Expand]] (<source lang=apl inline>/</source> and <source lang=apl inline>\</source>).
** Equivalents of normal primitive functions for operations on component of files as if they were elements of a vectors: <syntaxhighlight lang=apl inline>⍐</syntaxhighlight> and <syntaxhighlight lang=apl inline>⍗</syntaxhighlight> acted like [[Take]] and [[Drop]] (<syntaxhighlight lang=apl inline>↑</syntaxhighlight> and <syntaxhighlight lang=apl inline>↓</syntaxhighlight>). <syntaxhighlight lang=apl inline>⌼</syntaxhighlight> would [[Reverse]] and [[Rotate]] (<syntaxhighlight lang=apl inline>⌽</syntaxhighlight>). <syntaxhighlight lang=apl inline>⍁</syntaxhighlight> and <syntaxhighlight lang=apl inline>⍂</syntaxhighlight> were [[Compress]] and [[Expand]] (<syntaxhighlight lang=apl inline>/</syntaxhighlight> and <syntaxhighlight lang=apl inline>\</syntaxhighlight>).
** <source lang=apl inline>⍓</source> and <source lang=apl inline>⍌</source> and <source lang=apl inline>⍗</source> were used to hold, free, and release a file.
** <syntaxhighlight lang=apl inline>⍓</syntaxhighlight> and <syntaxhighlight lang=apl inline>⍌</syntaxhighlight> and <syntaxhighlight lang=apl inline>⍗</syntaxhighlight> were used to hold, free, and release a file.
** <source lang=apl inline>⌸</source> and <source lang=apl inline>⍯</source> returned maps for non-null and null components, respectively.
** <syntaxhighlight lang=apl inline>⌸</syntaxhighlight> and <syntaxhighlight lang=apl inline>⍯</syntaxhighlight> returned maps for non-null and null components, respectively.
** <source lang=apl inline>⌻</source> provided meta information about a file or the file system.
** <syntaxhighlight lang=apl inline>⌻</syntaxhighlight> provided meta information about a file or the file system.


== References ==
== References ==
<references/>
<references/>
{{APL dialects}}[[Category:APL dialects]][[Category:Flat array languages]]
{{APL dialects}}[[Category:APL dialects]][[Category:Flat array languages]]

Navigation menu