Kap: Difference between revisions

Jump to navigation Jump to search
18 bytes added ,  22:01, 10 September 2022
m
Text replacement - "</source>" to "</syntaxhighlight>"
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</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.
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 ==

Navigation menu