trusted
32
edits
(Fixed name of project KAP -> Kap) |
|||
Line 20: | Line 20: | ||
}} | }} | ||
''' | '''Kap''' is an array-based language that aims to implement most of standard APL, along with additional features. Much of standard APL works in Kap, although if an APL feature does not fit with Kap's design, those features are changed or removed. | ||
== Lazy evaluation == | == Lazy evaluation == | ||
The main difference compared to APL is that | 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, <syntaxhighlight lang=apl inline>↑ f¨ ⍳10</syntaxhighlight> will only make a single call to <syntaxhighlight 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 == | ||
The following is a list of significant differences compared to APL:<ref>Mårtenson, Elias. [https://kapdemo.dhsdevelopments.com/kap-comparison.html | The following is a list of significant differences compared to APL:<ref>Mårtenson, Elias. [https://kapdemo.dhsdevelopments.com/kap-comparison.html Kap for APL’ers]. Unversioned. Retrieved 2023-08-13.</ref> | ||
* Lazy evaluation | * Lazy evaluation |