Konubinix' opinionated web of thoughts

Clk and Contextual Polymorphism


clk and contextual polymorphism

Because clk alias, clk parameters, clk plugins or clk extensions are found depending on the context where the command is called, they can override the clk abstraction flow on the fly.

This means that you can have a flow configure -> build and have it call ./configure && make on one project or cmake && ninja on another, because the local configuration of each project indicates how to implement the flow.

use clk extension to ease contextual polymorphism

When you want to start a cmake project, chances are that you need to create the same implementations of the configure and build commands each time.

If that is so, you can implement them in a clk extension, called cmake, and then install this extension in the local profile of each project that needs it.

With the mechanism of extension dependencies, the local profile can even indicate the dependency that will be automatically resolved on the fly.

Notes linking here