Access Control Syntax

18 points by MatheusRich


mattya

I think modifier sections wouldn’t be too bad if they were explicit blocks.Something like:

local
  rec Vec
    // …
  end

  def sayHi()
    // …
  end
end
matklad

My color for bike shed:

nothing, pub, export/pub* for “visible in the file”, “visible in the current unit of compilation/distribution(crate)”, “visible across CUs”. The mid one is really important, and it’s a shame that Rust version requires two keywords and two sigils. “Can I change all call-sites?” is the physically meaningful aspect of access control, and CU-private captures that.

If I were going for scripty, public by default, I’d go for nothing for public and my for private: my def foo