4,501
edits
m (Undo previous; change one "influenced by" to "influenced") |
m (Text replacement - "<source" to "<syntaxhighlight") |
||
Line 20: | Line 20: | ||
! Name !! PAT statement !! Modern equivalent | ! Name !! PAT statement !! Modern equivalent | ||
|- | |- | ||
| [[Add]] || <code>Z = X + Y</code> || < | | [[Add]] || <code>Z = X + Y</code> || <syntaxhighlight lang=apl inline>Z ← X + Y</source> | ||
|- | |- | ||
| [[Subtract]] || <code>Z = X - Y</code> || < | | [[Subtract]] || <code>Z = X - Y</code> || <syntaxhighlight lang=apl inline>Z ← X - Y</source> | ||
|- | |- | ||
| [[Multiply]] || <code>Z = X * Y</code> || < | | [[Multiply]] || <code>Z = X * Y</code> || <syntaxhighlight lang=apl inline>Z ← X × Y</source> | ||
|- | |- | ||
| [[Divide]] || <code>Z = X @D Y</code> || < | | [[Divide]] || <code>Z = X @D Y</code> || <syntaxhighlight lang=apl inline>Z ← X ÷ Y</source> | ||
|- | |- | ||
| [[And]] || <code>Z = X @A Y</code> || < | | [[And]] || <code>Z = X @A Y</code> || <syntaxhighlight lang=apl inline>Z ← X ∧ Y</source> | ||
|- | |- | ||
| [[Or]] || <code>Z = X @O Y</code> || < | | [[Or]] || <code>Z = X @O Y</code> || <syntaxhighlight lang=apl inline>Z ← X ∨ Y</source> | ||
|- | |- | ||
| [[Constant]] Zero || <code>Z = X @000 Y</code> || < | | [[Constant]] Zero || <code>Z = X @000 Y</code> || <syntaxhighlight lang=apl inline>Z ← X(=≠=)Y</source> | ||
|- | |- | ||
| [[Greater than]] || <code>Z = X @001 Y</code> || < | | [[Greater than]] || <code>Z = X @001 Y</code> || <syntaxhighlight lang=apl inline>Z ← X > Y</source> | ||
|- | |- | ||
| [[Equal]] || <code>Z = X @010 Y</code> || < | | [[Equal]] || <code>Z = X @010 Y</code> || <syntaxhighlight lang=apl inline>Z ← X = Y</source> | ||
|- | |- | ||
| [[Greater than or equal]] || <code>Z = X @011 Y</code> || < | | [[Greater than or equal]] || <code>Z = X @011 Y</code> || <syntaxhighlight lang=apl inline>Z ← X ≥ Y</source> | ||
|- | |- | ||
| [[Less than]] || <code>Z = X @100 Y</code> || < | | [[Less than]] || <code>Z = X @100 Y</code> || <syntaxhighlight lang=apl inline>Z ← X < Y</source> | ||
|- | |- | ||
| [[Not equal]] || <code>Z = X @101 Y</code> || < | | [[Not equal]] || <code>Z = X @101 Y</code> || <syntaxhighlight lang=apl inline>Z ← X ≠ Y</source> | ||
|- | |- | ||
| [[Less than or equal]] || <code>Z = X @110 Y</code> || < | | [[Less than or equal]] || <code>Z = X @110 Y</code> || <syntaxhighlight lang=apl inline>Z ← X ≤ Y</source> | ||
|- | |- | ||
| [[Constant]] One || <code>Z = X @111 Y</code> || < | | [[Constant]] One || <code>Z = X @111 Y</code> || <syntaxhighlight lang=apl inline>Z ← X(===)Y</source> | ||
|- | |- | ||
| "Ceiling" ([[Maximum]]) || <code>Z = X @C Y</code> || < | | "Ceiling" ([[Maximum]]) || <code>Z = X @C Y</code> || <syntaxhighlight lang=apl inline>Z ← X ⌈ Y</source> | ||
|- | |- | ||
| "Floor" ([[Minimum]]) || <code>Z = X @F Y</code> || < | | "Floor" ([[Minimum]]) || <code>Z = X @F Y</code> || <syntaxhighlight lang=apl inline>Z ← X ⌊ Y</source> | ||
|- | |- | ||
| [[Exponential]] || <code>Z = X @E Y</code> || < | | [[Exponential]] || <code>Z = X @E Y</code> || <syntaxhighlight lang=apl inline>Z ← X * Y</source> | ||
|- | |- | ||
| [[Assignment]] || <code>Z = X</code> || < | | [[Assignment]] || <code>Z = X</code> || <syntaxhighlight lang=apl inline>Z ← X</source> | ||
|- | |- | ||
| [[Not]] || <code>Z = @N X</code> || < | | [[Not]] || <code>Z = @N X</code> || <syntaxhighlight lang=apl inline>Z ← ~ X</source> | ||
|- | |- | ||
| [[Absolute value]] || <code>Z = @A X</code> || < | | [[Absolute value]] || <code>Z = @A X</code> || <syntaxhighlight lang=apl inline>Z ← | X</source> | ||
|- | |- | ||
| [[Circular|Sine]] || <code>Z = @S X</code> || < | | [[Circular|Sine]] || <code>Z = @S X</code> || <syntaxhighlight lang=apl inline>Z ← 1 ○ X</source> | ||
|- | |- | ||
| [[Circular|Cosine]] || <code>Z = @C X</code> || < | | [[Circular|Cosine]] || <code>Z = @C X</code> || <syntaxhighlight lang=apl inline>Z ← 2 ○ X</source> | ||
|- | |- | ||
| [[Log]] (base 10) || <code>Z = @L X</code> || < | | [[Log]] (base 10) || <code>Z = @L X</code> || <syntaxhighlight lang=apl inline>Z ← 10 ⍟ X</source> | ||
|- | |- | ||
| [[Round up]] || <code>Z = @U X</code> || < | | [[Round up]] || <code>Z = @U X</code> || <syntaxhighlight lang=apl inline>Z ← ⌈ X</source> | ||
|- | |- | ||
| [[Round down]] || <code>Z = @D X</code> || < | | [[Round down]] || <code>Z = @D X</code> || <syntaxhighlight lang=apl inline>Z ← ⌊ X</source> | ||
|- | |- | ||
| [[Matrix]] [[Transpose]] || <code>Z = @T X</code> || < | | [[Matrix]] [[Transpose]] || <code>Z = @T X</code> || <syntaxhighlight lang=apl inline>Z ← ⍉ X</source> | ||
|- | |- | ||
| [[Reduction]]* || <code>Z = @U X</code> || < | | [[Reduction]]* || <code>Z = @U X</code> || <syntaxhighlight lang=apl inline>Z ← +/ X</source> | ||
|- | |- | ||
| [[Base]] || <code>Z = X @B Y</code> || < | | [[Base]] || <code>Z = X @B Y</code> || <syntaxhighlight lang=apl inline>Z ← X ⊥ Y</source> | ||
|- | |- | ||
| [[Residue]] || <code>Z = X @W Y</code> || < | | [[Residue]] || <code>Z = X @W Y</code> || <syntaxhighlight lang=apl inline>Z ← X | Y</source> | ||
|- | |- | ||
| [[Compression]] || <code>Z = U / X</code> || < | | [[Compression]] || <code>Z = U / X</code> || <syntaxhighlight lang=apl inline>Z ← U / X</source> | ||
|- | |- | ||
| Post <code>Z</code> with <code>X</code> controlled by <code>U</code> || <code>Z = U @P X</code> || | | Post <code>Z</code> with <code>X</code> controlled by <code>U</code> || <code>Z = U @P X</code> || | ||
|- | |- | ||
| [[Reshape|Dimension array]] || <code>@D X , C , R</code> || < | | [[Reshape|Dimension array]] || <code>@D X , C , R</code> || <syntaxhighlight lang=apl inline>X ← R C ⍴ X</source> or <syntaxhighlight lang=apl inline>X ⍴⍨← R C</source> | ||
|- | |- | ||
| [[Catenate|Juxtaposition]] || <code>Z = X , X</code> || < | | [[Catenate|Juxtaposition]] || <code>Z = X , X</code> || <syntaxhighlight lang=apl inline>Z ← X , X</source> | ||
|- | |- | ||
| Left [[rotate]] || <code>Z = K @L X</code> || < | | Left [[rotate]] || <code>Z = K @L X</code> || <syntaxhighlight lang=apl inline>Z ← K ⌽ X</source> | ||
|- | |- | ||
| Right [[rotate]] || <code>Z = K @R X</code> || < | | Right [[rotate]] || <code>Z = K @R X</code> || <syntaxhighlight lang=apl inline>Z ← (-K) ⌽ X</source> | ||
|- | |- | ||
| Compare and [[branch]] || <code>X @C Y, A, B, C</code> || | | Compare and [[branch]] || <code>X @C Y, A, B, C</code> || | ||
Line 94: | Line 94: | ||
| Update <code>X</code>, compare and branch || <code>@U X , Y , A , B , C</code> || | | Update <code>X</code>, compare and branch || <code>@U X , Y , A , B , C</code> || | ||
|- | |- | ||
| [[Range|Interval]] || <code>Z = @I I , J</code> || < | | [[Range|Interval]] || <code>Z = @I I , J</code> || <syntaxhighlight lang=apl inline>Z ← I … J</source> | ||
|- | |- | ||
| Mid-selection array || <code>Z = @M I , J</code> || | | Mid-selection array || <code>Z = @M I , J</code> || | ||
Line 100: | Line 100: | ||
| Get data (cards) || <code>@G X</code> || | | Get data (cards) || <code>@G X</code> || | ||
|- | |- | ||
| Type data || <code>@T X</code> || < | | Type data || <code>@T X</code> || <syntaxhighlight lang=apl inline>⎕ ← X</source> | ||
|- | |- | ||
| Transform floating–alphanumeric || <code>Z = @X Y</code> || < | | Transform floating–alphanumeric || <code>Z = @X Y</code> || <syntaxhighlight lang=apl inline>Z ← ⎕UCS Y</source> or <syntaxhighlight lang=apl inline>Z ← ⎕AF X</source> | ||
|- | |- | ||
| Accept data from typewriter || <code>@A X</code> || < | | Accept data from typewriter || <code>@A X</code> || <syntaxhighlight lang=apl inline>X ← ⍞</source> | ||
|- | |- | ||
| Type heading message and proceed || <code>@H any heading</code> || | | Type heading message and proceed || <code>@H any heading</code> || |