Skip to content

Instantly share code, notes, and snippets.

@aucker
Created March 30, 2022 02:11
Show Gist options
  • Save aucker/798ac0f99a4acd240bb8b8deb17e1016 to your computer and use it in GitHub Desktop.
Save aucker/798ac0f99a4acd240bb8b8deb17e1016 to your computer and use it in GitHub Desktop.
RUST区别于其他语言的空指针问题

特殊指针(引用),代表指向对象为‘空’,如null, nil, None, Nothing, nullptr等。Tony Hoare。 仅仅因为容易实现。

问题:违背了类型系统的初衷。

Type is a classification identifying one of various types of data, that detemines the possible values for that type, the oprations that can be done on values of that type, the meaning of the data, and the way values of that type can be stored.

类型规定了数据可能的取值范围,规定了在这些值上可能的操作,也规定了这些数据代表的含义,还规定了这些数据的存储方式。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment