4,493
edits
m (Fix formatting error) |
m (Text replacement - "</source>" to "</syntaxhighlight>") |
||
Line 23: | Line 23: | ||
== Lazy evaluation == | == Lazy evaluation == | ||
The main difference compared to APL is that KAP is lazy-evaluated. This means that the language gives the developers very loose guarantees when (or if, and how many times) a function will actually be invoked. For example, <source lang=apl inline>↑ f¨ ⍳10</ | The main difference compared to APL is that KAP is lazy-evaluated. This means that the language gives the developers very loose guarantees when (or if, and how many times) a function will actually be invoked. For example, <source lang=apl inline>↑ f¨ ⍳10</syntaxhighlight> will only make a single call to <source lang=apl inline>f</syntaxhighlight> because <code>f¨ ⍳10</code> will not immediately evaluate the result but only return a delayed evaluation. Since all but the first result is then discarded, those results will never be computed. | ||
== Differences from APL == | == Differences from APL == |