This repository has been archived by the owner on Nov 18, 2021. It is now read-only.
Replies: 2 comments 1 reply
-
@NReilingh apologies for the delay in replying here. I'll defer to @mpvl on the history/reasoning behind this, but here are my thoughts FWIW 😄
|
Beta Was this translation helpful? Give feedback.
1 reply
-
This discussion has been migrated to cue-lang/cue#892. For more details about CUE's migration to a new home, please see cue-lang/cue#1078. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm not sure where this comes from exactly, but I have an expectation that when something like a validation error based on a regex or string comes back to the terminal, the strings should be printed in their interpreted (semantic?) forms instead of the source code representation of a string sequence literal.
What makes sense to me in theory is that when the program is outputting an informational string to me to tell me what value is invalid, it should tell me the actual value, not the literal sequence that I needed to escape for syntax constraints. After all, the reader doesn't need escape sequences in order to parse the string correctly with their eyes and brain -- and if someone were to want to pipe this output into a different tool, they would be be responsible for escaping it again per the tool's requirements.
Practically, I also want the error to help me confirm that I did the escaping properly. When creating RegEx constraints, in particular, you often need an oppressive number of backslashes unless you use a different escape delimiter.
Also worth noting that what
cue
currently does is not to simply parrot the source code representation back at you -- if you give it values using an altered escape delimiter like\#
, it will still give you back values that have been re-escaped in a JSON-like style:test1.cue
$ cue eval test1.cue
In contrast, my expected behavior would be along the lines of:
test2.cue
$ cue eval test2.cue
Thoughts?
Beta Was this translation helpful? Give feedback.
All reactions