Download Dyalog Idioms CHEAT SHEET and more Summaries English in PDF only on Docsity! Dyalog Idioms CHEAT SHEET Dyalog v15.0 Idioms Key to the types and ranks of the arguments in the idioms: Type Description Rank Description C Character S Scalar or single item vector B Boolean V Vector N Numeric M Matrix P Nested A Array of any rank X any type The idioms described below must be entered precisely as shown to be recognised. Idiom Description ⍴⍴XA The rank of XA (returned as a one-element vector) ≢⍴XA The rank of XA (returned as a scalar) BV/⍳NS The subset of NS corresponding to the 1s in BV BV/⍳⍴XV The positions in XV corresponding to the 1s in BV NA⊃¨⊂XV The subset of XV in the index positions defined by NA (equivalent to XV[NA]) XA1{}XA2 XA1 and XA2 are ignored (no result produced) XA1{⍺}XA2 XA1 (XA2 is ignored) XA1{⍵}XA2 XA2 (XA1 is ignored) XA1{⍺ ⍵}XA2 XA1 and XA2 as a two item vector (XA1 XA2) {0}XA 0 irrespective of XA {0}¨XA 0 corresponding to each item of XA ,/PV The enclose of the items of PV catenated along their last axes ⍪/PV The enclose of the items of PV catenated along their first axes ⊃⌽XA The item in the top right of XA (⎕ML<2) ↑⌽XA The item in the top right of XA (⎕ML≥2) ⊃⌽,XA The item in the bottom right of XA (⎕ML<2) ↑⌽,XA The item in the bottom right of XA (⎕ML≥2) 0=⍴XV 1 if XV has a shape of zero, 0 otherwise 0=⍴⍴XA 1 if XA has a rank of zero (scalar), 0 otherwise 0=≡XA 1 if XA has a depth of zero (simple scalar), 0 otherwise XM1{(↓⍺)⍳↓⍵}XM2 A simple vector comprising as many items as there are rows in XM2, where each item is the number of the first row in XM1 that matches each row in XM2. ↓⍉↑PV A nested vector comprising vectors that each correspond to a position in the original vectors of PV – the first vector contains the first item from each vector in PV, padded to be the same length as the largest vector, and so on (⎕ML<2) ↓⍉⊃PV A nested vector comprising vectors that each correspond to a position in the original vectors of PV – the first vector contains the first item from each vector in PV, padded to be the same length as the largest vector, and so on (⎕ML≥2) ^\' '=CA A Boolean mask indicating the leading blank spaces in each row of CA +/^\' '=CA The number of leading blank spaces in each row of CA +/^\BA The number of leading 1s in each row of BA {(∨\' '≠⍵)/⍵}CV CV without any leading blank spaces {(+/^\' '=⍵)↓⍵}CV CV without any leading blank spaces ~∘' '¨↓CA A nested vector comprising simple character vectors constructed