structural-typing
Why interfaces must be declared in Java?
Sometimes we have several classes that have some methods with the same signature, but that don\'t correspond to a declared Java interface. For example, both JTextField and JButton (among several other[详细]
2023-02-25 21:37 分类:问答Why this structural type bound does not work as expected?
I\'m trying to write a simple helper method that receives something that can be closed and some function which receives the former and ensures the \"closeable\" is closed after executing the function.[详细]
2023-02-07 00:34 分类:问答Clojure Protocols vs Scala Structural Types
After watching the interview with Rich Hickey on Protocols in Clojure 1.2, and knowing very little开发者_如何转开发 about Clojure, I have some questions on Clojure Protocols:[详细]
2023-01-31 14:23 分类:问答Funny observation about (recursive) structural types in Scala
I needed some recursive structural type in some piece of code using with traits and the structural type as type parameter constraint. It worked fine, but later I learned Scala does not support recursi[详细]
2023-01-14 05:57 分类:问答Why do compile-time generative techniques for structural typing prevent separate compilation?
I was reading (ok, skimming) Dubochet and Odersky\'s Compiling Structural Types on the JVM and was confused by the following claim:[详细]
2023-01-11 16:40 分类:问答Generalized structural type conformance in Scala
I\'m interested in the problem of conforming a specific type to a more general structural type.Consider the following examples:[详细]
2023-01-11 03:10 分类:问答Scala - how to define a structural type that refers to itself?
I\'m trying to write a generic interpolate method that works on any type that has two methods, a * and a +, like this:[详细]
2023-01-06 05:51 分类:问答Optional structural typing possibility in C++ or any other language?
In C++ how to tell compiler that Ogre::Vector3 IS_SAME_AS SomeOtherLIB::Vector3 ? I feel that.. in languages like c++ which are not structural typed but th开发者_Go百科ere are cases when it makes sens[详细]
2023-01-01 15:45 分类:问答Using Scala structural types with abstract types
I\'m trying to define a structural type defining any collection that has an \"add\" method (for instance, a java collection). Using this, I want to define a few higher order functions that operate on[详细]
2022-12-28 15:47 分类:问答Namespace scoped aliases for generic types in C#
Let\'s have a following example: public class X { } public class Y { } public class Z { } public delegate IDictionary<Y, IList<Z>> Bar(IList<X> x, int i);[详细]
2022-12-26 13:16 分类:问答