Kap: Difference between revisions

Jump to navigation Jump to search
No change in size ,  27 January
Fixed name of project KAP -> Kap
m (Loke moved page KAP to Kap: Official name change)
(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.
'''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 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.
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 KAP for APL’ers]. Unversioned. Retrieved 2023-08-13.</ref>
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
trusted
32

edits

Navigation menu