You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Feb 3, 2020. It is now read-only.
The reason brain has been using u8 instead of a type called char is because we have been reserving char for when we finally have time to implement unicode support. The problem is that the concept of a "character" extends far beyond ascii so if we ever want this to be useful we should add support for unicode from the get go.
The char type represents a single character. More specifically, since 'character' isn't a well-defined concept in Unicode, char is a 'Unicode scalar value', which is similar to, but not the same as, a 'Unicode code point'.
The reason brain has been using
u8
instead of a type calledchar
is because we have been reservingchar
for when we finally have time to implement unicode support. The problem is that the concept of a "character" extends far beyond ascii so if we ever want this to be useful we should add support for unicode from the get go.See Rust's implementation of a unicode char: https://doc.rust-lang.org/beta/std/primitive.char.html
Possibly useful regarding the memory layout: https://www.youtube.com/watch?v=kPR8h4-qZdk
char
typestr
typeThe text was updated successfully, but these errors were encountered: