On Saturday, 19 May 2018 at 04:01:18 UTC, KingJoffrey wrote:
So I've come full circle again, and believe my idea is worth further consideration.

how about this (use a proper annotation).

This will be less likely to confuse anyone from other languages.

e.g

-------------------
module test;

@safeinterface class Dog
{
    private string noiseType = "woof";

    public string makeNoise()
    {
        return this.noiseType;
    }
}

void main()
{
    import std.stdio;

    auto dog = new Dog;
dog.noiseType = "meow"; // no way jose - requires use of the safe interface!
    writeln(dog.makeNoise()); // phew! cause dogs can only bark.
}
-------------------

Reply via email to