Is there a private/public attribute for members? #1101
-
Hello, I am exploting Pkl to configure a distributed simulation environment with multiple machines. Every machine has its own settings format, and the idea is to use Pkl to centralize the configuration and output properly-formatted files to share with the machines. Sometimes, I feel the machine-level configuration (to which I have no access) could be written better; for this, in the corresponding An example: class Host {
hostname : String
port: Int
protocol: 'tcp' | 'udp'
}
hidden host : Host
hostname : String = host.hostname
port : Int = host.port
This allows me to only edit the However, users can theoretically still manually set the Is there any way to make |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
You're looking for the |
Beta Was this translation helpful? Give feedback.
You're looking for the
fixed
modifier! See https://pkl-lang.org/main/current/language-reference/index.html#fixed-properties