-
-
Couldn't load subscription status.
- Fork 72
In stepper, respect the number-display format of the language. #246
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
base: master
Are you sure you want to change the base?
Conversation
|
I should not that the snips don't look very good, but this needs to be fixed in the framework. |
|
Is there a place to add a test case for this one?
Robby
…On Tue, Apr 29, 2025 at 6:35 AM Mike Sperber ***@***.***> wrote:
*mikesperber* left a comment (racket/htdp#246)
<#246 (comment)>
I should not that the snips don't look very good, but this needs to be
fixed in the framework.
—
Reply to this email directly, view it on GitHub
<#246 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AADBNMGS62M26AGQLEY4UFL235PZXAVCNFSM6AAAAAB4CUJYP6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDQMZYGMZDIMJXGY>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
A meaningful test for this would have to look at the actual live UI of the stepper - I haven't seen that yet. (Or am I wrong, @jbclements ?) |
|
@mike no, there's no way to look at the live GUI output that I know of, though I can add a manual checklist item to manual-tests. You probably have an easy example that I can test? Broadly speaking: this definitely seems like an improvement. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It certainly seems like the existing code ignored the existing pretty-print-size-hook, and I can't see why that would be a good thing. The direct use of format with ~s definitely seems less likely to be correct.
|
@rfindler Any chance you could help with making the number snips use the same font size as the |
|
In addition to the font size, the number snips don't follow the settings in the language dialog for the language-dialog version of BSL. When I change the setting to "Mixed fractions" in the language dialog customization of BSL, I still see repeating-decimals printing in the stepper. (It might depend on my preferences, tho, so you might need to use "Repeating decimals" to get the bad behavior.) |
|
Also, when I am trying things out, sometimes I see "placeholder26196" in the stepper where the fraction is supposed to go. I'm not sure how to make this happen but maybe it has to do with whether or not the language-based BSL is chosen when DrRacket starts up? |
|
@rfindler For me, the stepper respects the preferences. (And the code for that is unchanged.) Also, do you have any advice on how to fix font size? |
|
Logging here that I figured out what @rfindler was seeing: For the menu-based languages, the stepper doesn't receive the language-specific pretty-print hooks, and then everything goes to hell. So that also needs to be fixed. |
To that end, call the underlying pretty-print-print-handler instead of format, and transform write-special'ed number markup into the corresponding snip.
2c1e16a to
a56ccc9
Compare
|
After |
|
It seems to me that the way the stepper plugs into drracket when it is being used in the menu-based teaching languages needs to make sure that the pretty-print hooks make their way over so they are set up by the time we get to It looks like information about the specific language are coming into |
|
I see that there is the function |
@rfindler Yes, but for calling it the code requires access to the Output Syntax settings approximately here: htdp/htdp-lib/lang/htdp-langs.rkt Line 727 in a4809bc
Note that calling |
|
IIUC, the stepper has several object/classes for the teaching languages (one for each). I'm suggesting that that code in those objects call the |
@rfindler I understand that - but to call it, I need the settings. (The settings is not the language, but - in this case - the output format.) |
|
Looking a little bit more here, maybe the right thing is for the stepper to call the I'm sorry -- I thought I'd found a place in the stepper where those objects are created to try to track down if the information can be plumbed though from those to this point but I'm not seeing it anymore. @jbclements does what we are saying here make any sense? |
I'm afraid I have to repeat myself - the two |
|
@rfindler The code path you probably want to know starts here: htdp/htdp-lib/stepper/stepper-tool.rkt Line 196 in 7bf2b09
... and then goes here: htdp/htdp-lib/stepper/stepper-tool.rkt Line 307 in 7bf2b09
|
To that end, call the underlying pretty-print-print-handler instead of format, and transform write-special'ed number markup into the corresponding snip.