kuroko-lang / kuroko

Dialect of Python with explicit variable declaration and block scoping, with a lightweight and easy-to-embed bytecode compiler and interpreter.
https://kuroko-lang.github.io/
MIT License
427 stars 25 forks source link

Move `setlocale()` from `rline()` to the top of `main()` #49

Closed kseistrup closed 6 months ago

kseistrup commented 6 months ago

Having the setlocale() stuff in the rline() function only, invites kuroko to behave differently in a script and in the REPL.

The path of least surprise is to initialize the locale at the top of the main() entry point, before arguments have been parsed and before other routines have been called.

This pull-request:

Disclaimer: I don't really speak C, but I have tried to match your indentation style, and the code compiles cleanly and passes all tests.