in Raku, this is:
class A {
has $!bar; #private
has $.baz; #public (with autogenerated accessors)
method !foo {} #private
method foz {} #public
}