Common Patterns

From The K Language Wiki
Revision as of 07:50, 28 July 2021 by Razetime (talk | contribs)

This page is intended as a list of commonly used snippets and functions that can be used in K code.

If you would like to add to this list, modify the template given in Format: Common Pattern and paste it in.

Patterns

Sum

+/

Description: function to sum an array. Can be used with initial value.

Examples +/1 2 3 4 5 -> 15 +/(1 2;2 3) -> 3 5

Dialects: all

Primitives: plus, over