I grew up with mathematical notations such as
Now, I really believe that our programming systems should support such mathematical systems.
But seeing as most don't, I often wrestle with textural notation.
Here's a pleasant textual notation I came up with today:
first, the usual sum or sigma:
sum for i from 1 to N of A[i]
to create a vector
v[i], i=1,n
::== vector for i from 1 to N of v[i]
combining
vector for j from 1 to N of
sum for i from 1 to N of A[j+i]*B[j+N-i]
other
integral for i from 1 to N of f(i)
union for i from 1 to N of f(i)
intersection for i from 1 to N of f(i)
product for i from 1 to N of f(i)
continued fraction for i from 1 to N of f(i)
::== 1/(1+1/(f(1)+1/(1+1/f(2) + ...
2D
array
for i from 1 to M,
for j from 1 to N
of A[i,j]
3D
array
for i from 1 to N,
for j from 1 to M,
for k from 1 to L
of A[i,j,k]
shaped
array
for i from 1 to N,
for j from i to 2*i,
for k from 1 to j
of A[i,j,k]