mirror of
https://github.com/apple/pkl.git
synced 2026-06-15 10:04:30 +02:00
Pkl ignores format when evaluating expressions #233
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @pauloborges on GitHub (Oct 26, 2024).
Example file:
Evaluating the whole file works as expected:
But evaluating an expression ignores the format argument:
@HT154 commented on GitHub (Oct 27, 2024):
This is currently expected behavior and not a bug, but this is definitely a valid feature request. You can emulate the desired behavior using
-x 'output.renderer.renderValue(<expr>).You can see how the output format selection is implemented here, which might help explain what's happening here: https://github.com/apple/pkl/blob/466ae6fd4c72aa7ccabde970131eccbc2a690b12/stdlib/base.pkl#L93-L107
@ThinkChaos commented on GitHub (Jan 17, 2025):
The workaround above doesn't work, it should be
-x 'module.output.renderer.renderValue(<expr>)