Comment by 1-more
8 hours ago
> I love explaining +/%#
Based on the one thing I remember in APL I'm guessing the first two characters are "sum over some data structure" and the data structure is what the next two mean. What does it mean entirely?
8 hours ago
> I love explaining +/%#
Based on the one thing I remember in APL I'm guessing the first two characters are "sum over some data structure" and the data structure is what the next two mean. What does it mean entirely?
avg=: +/ % #
+/ sums the items of the array.
# counts the number of items in the array.
% divides the sum by the number of items.
delightful, ty. How does it handle empty arrays? Throw? Average is zero? Average is infinity?
Average is zero
1 reply →
I'd call that code obfuscation.
you would not need an explanation.
K et al. can look like that, but this example doesn't require any explanation to someone who has any familiarity.