4,494
edits
No edit summary |
(inline code to improve sentence flow) |
||
Line 21: | Line 21: | ||
== 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, | 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</source> will only make a single call to <source lang=apl inline>f</source> 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. | ||
<source lang=apl> | |||
</source> | |||
== Differences from APL == | == Differences from APL == |