名义具体化的类型系统

在 C# 或 Java 中,任何给定的值或对象都具有一种确切的类型 - null、原始类型或已知的类类型。我们可以调用 value.GetType()value.getClass() 之类的方法来在运行时查询确切的类型。这种类型的定义将驻留在某个具有某个名称的类中,我们不能使用两个具有相似形状的类来代替彼此,除非存在显式继承关系或共同实现的接口。

In C# or Java, any given value or object has one exact type - either null, a primitive, or a known class type. We can call methods like value.GetType() or value.getClass() to query the exact type at runtime. The definition of this type will reside in a class somewhere with some name, and we can't use two classes with similar shapes in lieu of each other unless there's an explicit inheritance relationship or commonly-implemented interface.

evMHGwI2MoBJWFo8I7zROaZsOr3hi9l2TumyqiTr7heAoToOf8iMrBthZ8WIt7rocf0i+e6ztBenDxjquWcVG0PDXwsHuvZirvThwk5RdK7HemzYJSen6uMdye+9b2WcVfcZlEJP4yQ5CAE3Zuh03Y5htLEVzxOajYu7oeMTsF+FWKLjPA4k/JiJtF3g2+9FSbEdHawwhgHjS9Z6IwZOhtZV3ieqO23B3qcDmVLhvwzLxNsIZcJz5qdTn1yia0T6zvHglE3gsHQOMEEfF5pPaumnKKoAMVpG1wlUzAiU+LhsvA1WD7gFxwkeLw2BJCLSsGdMLgyLocVd0TMJi/sh+Ozl2nrBo2TGCkkokel0mx+Lr/xr0jY2h+R2dAqPWjd39PPo+ZAaUrlmw+MhtvUpbxPjyTXcbBjnsPZxTPgdlNl7NfrFnjJzFdQsEUhWignIHEgzowmcRxNVeEjXoQlDDSm9Y8A8En2v8hVjLWnO63b5glEGHPVgkcfvK+RSv3fjCjs3J+Z0g2bci0cwaYtExA==