Why newExpr
requires new
keyword?
#419
Replies: 3 comments 15 replies
-
Most of the |
Beta Was this translation helpful? Give feedback.
-
Yes, I know but I'd like to use the same assignment notation like below.
In addition, an
|
Beta Was this translation helpful? Give feedback.
-
In Pkl, object bodies always amend something. class Person {
name: String
birthday: String
}
people = new Listing<Person> {
default { name = "Ellis" }
new { birthday = "2020/01/01" }
} Here, the Simply using people = new Listing<Person> {
default { name = "Ellis" };
{ birthday = "2020/01/01" }
} There's also a grammar ambiguity here; this is parsed as a chained amends expression myObj {
(foo) {}
{}
{}
{}
} |
Beta Was this translation helpful? Give feedback.
-
I have a question about
newExpr
.I'm using
YAML
as the input format of my app like this and tring to rewrite it by using Pkl.https://github.com/rggen/rggen-sample/blob/master/uart_csr.yml
This is the result.
This trial led me to think that
{}
blocks without new keyword looks better.Is there any reason why the
newExpr
requires thenew
keyword?Beta Was this translation helpful? Give feedback.
All reactions