Common Patterns

From The K Language Wiki
Revision as of 07:34, 28 July 2021 by Razetime (talk | contribs) (Add common patterns page)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

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.

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