I am looking for an adjective; one that describes the opposite of mutating. I want to use it to mark functions, methods and method parameters (including the receiver) as not being mutated by the function, similar how the D language does it.Ds approach works pretty well for parameters:class X {    void foo(const int x, immutable char[] y) {        // x is readonly        // y is readonly and can be trusted not to change    }}However, both immutable and const seem ugly when using them on the function/method itself to denote that the function does not modify the receiver object:// again Dclass X {    private int x;    void foo() const {        // x becomes readonly because the method is marked s such    }    void foo2() immutable {        // same as foo(): x is readonly    }}I am looking for a keyword with the same semantics as the above keywords in D; but as an adjective to be written before the function name:class X {    private x: int    non-mutating foo() {        // x is readonly    }}Using immutable reads like the method would be immutable (such as final in Java or non-Virtual in C#/C++). I cannot use the keyword after the parenthesis closing the parameter list because thats where the return type is supposed to go:fun x() -> IntI'm not entirely sure whether this is the correct place to ask this question. But since i did not find a programming language design SE, i figuerd the people knowing many programming languages in this community could give me a few pointers :)
Opposite of mutating
programming languages;terminology
In OO speak, functions that are known to change data are called modifiers and those that are known to just return something without change are called selectors. I do not hear the terms very often, somehow they are not popular. More popular are getters and setters.So you could use the qualifiers selector and modifier or getter and setter respectively.Most people would associate getter and setter with properties. This could be a reason to choose the other, seemingly forgotten terms.If you are only interested in the mutability of specific arguments, readonly may be appropriate.