タグ付けされた質問 「strong-typing」

10
主流の強力な静的OOP言語がプリミティブの継承を妨げるのはなぜですか?
なぜこれが大丈夫であり、ほとんど期待されているのですか: abstract type Shape { abstract number Area(); } concrete type Triangle : Shape { concrete number Area() { //... } } ...これはOKではなく、誰も文句を言いません: concrete type Name : string { } concrete type Index : int { } concrete type Quantity : int { } 私の動機は、コンパイル時の正当性検証のために型システムの使用を最大化することです。 PS:はい、私はこれを読んでおり、ラッピングはハッキングの回避策です。
弊社のサイトを使用することにより、あなたは弊社のクッキーポリシーおよびプライバシーポリシーを読み、理解したものとみなされます。
Licensed under cc by-sa 3.0 with attribution required.