riff-lang / riff

The Riff programming language
https://riff.cx
BSD Zero Clause License
23 stars 1 forks source link

`char()` should be able to serialize multi-character codes into their string representations #55

Closed darrylabbate closed 1 year ago

darrylabbate commented 1 year ago

Ex: char(ord('abcπ')) should return 'abcπ'

darrylabbate commented 1 year ago

Ex: char(ord('abcπ')) should return 'abcπ'

Upon reflection, this isn't actually possible unless ord() were to return the UTF-8 sequence of UTF-8 characters as an integer. Otherwise it's too ambiguous to decode a riff_int into a valid UTF-8 sequence. This is quite literally the entire point of encoding schemes like UTF-8.

And since char() explicitly takes in Unicode code points (as opposed to integers representing UTF-8 sequences), this simply doesn't work.