Skip to content

Can I set a pkl property value outside of an object declaration? #310

Answered by bioball
ericzbeard asked this question in Q&A
Discussion options

You must be logged in to vote

No; Pkl values are immutable, and there are also no statements in Pkl.

You can express another object that is derived from f using object amending:

class Foo {
    Bar: String
}

f = new Foo {
    Bar = "Baz"
}

g = (f) {
  Bar = "Something else"
}

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@ericzbeard
Comment options

@bioball
Comment options

Answer selected by ericzbeard
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants