You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In previous versions of KCL, the values of top-level expression statements were not output to JSON/YAML, such as the following example, which we can now support them.
1
[1, 2, 3]
{
a=1b=1
}
Pod {
apiVersion="v1"
}
Design
In previous versions of KCL, the values of top-level expression statements did not have any semantics. We can set their semantics to correspond to scalar values in JSON/YAML, giving KCL more semantics that is closer to Jsonlike. For example, the following KCL code will be output as JSON/YAML.
1
The output JSON/YAML is
1
We collectively refer to these values as scalars, The output principle of scalars in KCL is
All scalars undergo idempotent configuration merging, and an error is thrown when a collision error occurs during the merge. KCL does not output any JSON/YAML values.
Any scalar and nonscalar types cannot be merged because they are different types. For example, the following code will throw an error:
a=11# Error: conflict values between {a = 1} and 1
The text was updated successfully, but these errors were encountered:
Peefy
added
semantic
Issues or PRs related to kcl semantic and checker
runtime
Issues or PRs related to kcl runtime including value and value opertions
feat
labels
May 12, 2023
Feature
In previous versions of KCL, the values of top-level expression statements were not output to JSON/YAML, such as the following example, which we can now support them.
Design
In previous versions of KCL, the values of top-level expression statements did not have any semantics. We can set their semantics to correspond to scalar values in JSON/YAML, giving KCL more semantics that is closer to Jsonlike. For example, the following KCL code will be output as JSON/YAML.
1
The output JSON/YAML is
1
We collectively refer to these values as scalars, The output principle of scalars in KCL is
Example
Schema
The output YAML is
Conflict Value Errors
Reference
The text was updated successfully, but these errors were encountered: