htdp icon indicating copy to clipboard operation
htdp copied to clipboard

Stepper does not respect "Fraction Style"

Open LiberalArtist opened this issue 3 years ago • 1 comments

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".

LiberalArtist avatar Oct 06 '22 21:10 LiberalArtist

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.

jbclements avatar Nov 04 '23 23:11 jbclements