The 1 here is the "seed" or initial value for our running product.
And now we can see a way to generalise this.
Instead of 2⍴10 we could choose two different numbers.
E.g. 60 and 24
This gives us ⌽×\1 60 24 or 1440 60 1
This would be a days-hours-minutes system, 1 day being 1440 minutes.
So if we have 1 day, 2 hours, 3 minutes, how many minutes do we have?
+/1 2 3×1440 60 1
1563
This brings us to what ⊥ does. It takes a mixed-radix spec as left argument, and evaluates how many of the smallest unit a given "number" (expressed as a vector of "digits") corresponds to.
0 24 60⊥1 2 3
1563
Now, notice the difference in the spec between the +/× method and the ⊥ method.
We don't have to specify the unit (which'll always be 1 anyway) on the little end, but instead, we pad with a 0 on the big end. The 0 is ignored, and could actually be any value.
Because ⊥ has a specific definition rather than being some specialised type-dependent utility, it can be used for some unusual tricks that have little apparent connection to base-conversion.
One that has achieved some fame is ⊥⍨ on a Boolean vector. Let's analyse what it does.
Because conceptually, we add 1s from the right (though each is multiplied by increasing powers of 1 — all 1*n being always 1 of course), until a 0 causes everything after that to become 0 (n×0 being always 0 of course). Finally, we sum.
OK, another trick, often used in tacit APL is 1⊥something. Let's analyse that one.
The first thing we can recognise here is that the 1 will be expanded to match the length of the right argument, so say 1⊥3 1 4 really means 1 1 1⊥3 1 4
@JeffZeitlin Well done! Yes, pretty much. But remember the transposing when dealing with multi-dimensional arguments, and you'll soon realise that it is +⌿
OK, another trick, sometimes used in tacit APL is 0⊥something. Let's analyse that one.
I'm still missing something, because experimentally, it counts the number of digits you passed it on the right - but I'm not quite seeing how it gets there.
In Dyalog APL the character vector ⎕AV contains all characters in the Classic Dyalog APL character set. Where can i find information about what each character in ⎕AV stand for? I'm trying to find out what each control character in the ASCII encoding corresponds to in ⎕AV in order to filter out in...
Hint: a long-winded way would be to remove the leading 1 from the shape (by using ⍴ as both "shape" and "reshape"), but there's a shortcut in the form of (something)⌿.