source-academy / py-slang

Python sublanguage for SICP
Apache License 2.0
0 stars 0 forks source link

Display of numerical values #40

Open martin-henz opened 2 months ago

martin-henz commented 2 months ago

In Python §1, Python integers are represented by JS big ints, and Python floating point numbers by JS numbers (doubles). The display of values in the REPL should reflect this: We should append ".0" to JS numbers when we print them, in case JS stringify makes them look like integers:

print(100.000)

should show

100.0

in the REPL.

This should be doable with the new multi-language support in js-slang, see https://github.com/source-academy/js-slang/pull/1651/files.