-
-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clarify the formatting spec wrt. inspecting formattable values #515
Comments
Originally posted by @aphillips in #511 (comment) I think it has to work that way. I don't think "eager" evaluation is necessarily to a string. It is to a "formattable". Otherwise format-to-parts wouldn't work nor would (as you point out) later annotation. Also, selectors wouldn't work:
What "eager" evaluations might do is copy the value and modify the copy:
|
Here's the full set of methods/accessors that the proposed JS implementation uses:
As far as I can tell, that's the minimal set covering all the possibilities. If it's not clear that the spec effectively leads to that sort of an implementation, that might indeed be good to clarify in its text. |
Is it that the function has to return that, or that the formatter implementation has to bind the name By the way, this seems like a case for making the spec be less abstract about what a "resolved value" is allowed to be. |
One thing to note here is that the "raw underlying value" should in this case be the number |
I think this needs concrete suggestions in order to be actionable. Can we produce a PR with proposed changes? |
I'm working on a proposal for this. |
This commit also includes the changes to the spec implied by this design doc, but will be split up into separate commits before submitting a PR.
…nicode-org#515) Fix some errors in design doc
This commit also includes the changes to the spec implied by this design doc, but will be split up into separate commits before submitting a PR.
…nicode-org#515) Fix some errors in design doc
This proposed design doc addresses an issue titled "inspecting formattable values", which is really about dataflow through the formatter and structuring it to make function calls compose with each other.
This proposed design doc addresses an issue titled "inspecting formattable values", which is really about dataflow through the formatter and structuring it to make function calls compose with each other.
Moving to |
* Add design doc for dataflow for composability (#515) This proposed design doc addresses an issue titled "inspecting formattable values", which is really about dataflow through the formatter and structuring it to make function calls compose with each other. * Add pull request link * Add link to spec PR * Add correct image for second diagram * Add one more alternative * Add another alternative
Does #728 address this fully? (I think it does.) |
Hi @stasm. I know you've been busy. Are you satisfied with this issue's resolution? Thanks. |
Originally posted by @stasm in #511 (comment)
I'm not sure if the spec is currently clear enough about the requirement to allow functions to inspect the raw value and the formatting options of their arguments. Specifically, while a function may eagerly format its operand to a string, it should (must?) also return the raw underlying value and the formatting options used for formatting, in case another function wants to extend them or use them for other logic. Consider:
The text was updated successfully, but these errors were encountered: