racket / htdp

Other
91 stars 69 forks source link

Stepper does not respect "Fraction Style" #180

Open LiberalArtist opened 1 year ago

LiberalArtist commented 1 year 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 10 months 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.