THE CLPROLF PROGRAMMING LANGUAGE


The underst Method Modifier

The underst modifier (@Underst in the Clprolf framework) is used to mark methods whose implementation is not straightforward.

It highlights algorithms that are non-trivial, where the way a computer solves a task is different from how a human would naturally reason about it.


Purpose

Even with human-like algorithms (such as those written in Algol-like languages), it is sometimes tricky to express jobs for the computer. A classical example is sorting: while humans sort in a very direct way, computers need a step-by-step algorithm.


Example: Bubble Sort

Consider the bubble sort algorithm.

This approach is efficient for the computer, but it is not the intuitive human way. Therefore, the method should be marked with underst to indicate that the implementation is more technical than natural.


In Clprolf

public agent BubbleSorter {
    private int[] theElements;

    public int[] getElements() {
        return this.theElements;
    }

    public BubbleSorter(int[] theArray) {
        this.theElements = theArray;
    }

    public underst void sort() {
        // Non-trivial algorithm here
    }
}

In the Clprolf Java Framework

@Agent
public class BubbleSorter {
    private int[] theElements;

    public int[] getElements() {
        return this.theElements;
    }

    public BubbleSorter(int[] theArray) {
        this.theElements = theArray;
    }

    @Underst
    public void sort() {
        // Non-trivial algorithm here
    }
}

Benefits


Design Philosophy

Behind the underst modifier lies Clprolf’s philosophy of keeping implementations simple and explicit:

This ensures that all Clprolf code remains understandable, regardless of its complexity.