Jul 13 2026
In RIDE, to display function trains in tree format:
]box ON -trains=tree
Was OFF -trains=box
+/รทโข
โโโผโโ
/ รท โข
โโโ
+Turn a scalar into an array.
,5
5
โด,5
1
First element of an array.
โ
Last element of an array. Note the lack of symmetry with โ.
โข/
Flatten an array.
{,โต}
Check that an array is a palindrome.
โฝโกโข
Pad a number with a desired number of 0s.
11โ1 โ 1 followed by ten 0's.
1 0 0 0 0 0 0 0 0 0 0
Find the number of leading 1s in a boolean array.
+/โง\Sign of a number.
ร
Get the integral and fractional part of a non-negative real number.
0 1โโคCompare the performance of 3 functions F, G and H on the same input s.
'cmpx' โCY 'dfns'
cmpx 'F s' 'G s' 'H s'Sort an array in ascending order.
{โต[โโต]}
Order the rows of a matrix according to the sorted order of the second row.
โข mat โ 2 3 โด 1 4 2 5 9 7
1 4 2
5 9 7
mat[; โmat[2;]]
1 2 4
5 7 9
Find the index of the maximum element of an array. Recall that in APL indices start at 1.
โโAll uppercase English letters.
โA
ABCDEFGHIJKLMNOPQRSTUVWXYZ
All lowercase English letters.
โUCS 96+โณ26
abcdefghijklmnopqrstuvwxyz
Discard all characters except English letters.
a โ 'The quick brown fox! Jumps over the lazy... dog?'
aโฉโA,โUCS 96+โณ26
ThequickbrownfoxJumpsoverthelazydog
Convert a string to lowercase.
โC 'dYALog`
dyalog
ยฏ1 โC 'dYALog`
dyalog
Convert a string to uppercase.
1 โC 'dYALog`
dyalog
Case-insensitive string comparison. Note the use of โฅ (over), which monadically applies its right function to both arguments, and then dyadically applies its left function to the results.
'Dyalog' โกโฅโC 'DYALOG'
1
Check that a string is a palindrome after discarding non-alphabet characters. We convert to uppercase, discard everything that is not an uppercase letter, and then check that the result is a palindrome.
{(โฝโกโข) โAโฉโจ1โC โต}Generate an identity matrix.
โ.=โจ โณ
This is basically a tacit rephrasing of
{(โณโต)โ.=โณโต}
The following method is about as fast as it gets for generating an identity matrix. Right-pad 1 with โต zeroes and then repeat that array until the shape is โต โต.
{โต โตโด(โต+1)โ1}
This can be rephrased in tacit form as a 5-train. Note that we use ร (sign) to replace the positive input with 1. We could also use 1โจ or โข instead of ร.
,โจโด+โ1โร
Generate a random float between 0 and 1.
?0