racket / htdp

Other
93 stars 70 forks source link

Stepper does not respect "Fraction Style" #180

Open LiberalArtist opened 2 years ago

LiberalArtist commented 2 years ago

The teaching languages allow you to set the "Fraction Style" to either "Mixed fractions" or "Repeating decimals":

Screenshot of "Choose Language" window showing the details for the teaching languages.

However, the Stepper does not respect this choice. For example, 8.30167 (in HtDP lexical syntax, so an exact number) is printed by the stepper as 830167/100000, which is neither a "mixed fraction" not a "repeating decimal".

I haven't investigated the other options under "Output Syntax".

jbclements commented 1 year ago

Sorry for not commenting sooner. I'm not super-surprised here. This might be easy, but I'm guessing it might not. Specifically, the way that the stepper generates this text involves some unorthodox use of code-copying around the print-convert family of functions. The big-picture problem has to do with formatting output text but also obtaining the printed buffer locations of the beginning and ending of certain elements of the printed buffer. It may very well be that there's now an interface that provides a more disciplined way to do this. I should at least ask around.