I want to call it a side effect, but you need to be better at it.

What is the name of the following programming paradigm:

The code is executed based on a set of logic tests that enable true (sentence). A sentence consists of operators and operands. Each operand is a value / object.

Instead of explicitly evaluating the sentence as it is done in imperative languages ​​(for example, normal flow control, for example if(){} ), the sentence is declared and bound to the resulting code. When the proposal is executed, at any time in the future the code will be executed.

So this is basically a dependency tree that reevaluates whether the code should be executed whenever the dependency changes state.

eg.

 when(a && b && c < 3 && d.changes()) { runThisCode(); } 

I am looking for a more formal name and definition, and I did not come up with anything after searching for it. This is somewhere between declarative and imperative, but I have never seen a language or paradigm to do this.

Thanks Sean

+4
source share
2 answers

Sounds like a rule engine to me. For instance. in Jess, you can define such declarative rules and refer to imperative or object-oriented Java code.

+2
source

Source: https://habr.com/ru/post/1345509/


All Articles