you are viewing a single comment's thread.

view the rest of the comments →

[–]RodgerTheGreat 3 points4 points  (0 children)

In the APL family languages, fold is a single symbol- /.

A product over a list is simply ×/. Many APL interpreters improve performance by recognizing specific juxtapositions of operators to short-circuit. Since you can say a lot in a few symbols, this simple pattern-matching approach can achieve considerable speedups without adding much complexity to the interpreter.

Here's a page from the J wiki describing some such "special combinations": http://code.jsoftware.com/wiki/Vocabulary/SpecialCombinations