language-design
What's the rationale behind annotations implementing java.lang.reflect.Proxy?
It is not required by the language specification开发者_运维知识库 and seems to be vendor-specific.[详细]
2023-03-08 19:15 分类:问答Why does C# allow {} code blocks without a preceding statement?
Why does C# allow code blocks with开发者_运维百科out a preceding statement (e.g. if, else, for, while)?[详细]
2023-03-08 17:30 分类:问答Scala's .type and Java's .class literal
I wonder from a language design perspective why Scala has removed Java\'s class literal (e. g. String.class) and replaced it with classOf[String], but has then added a \"type literal\" with its Single[详细]
2023-03-08 08:24 分类:问答Is scala.Singleton pure compiler fiction?
The Scala Language Specification says under §3.2.1: A stable type is either a singleton type or a type which is declared to be[详细]
2023-03-08 00:10 分类:问答How to get the class of a singleton object at compile time?
Consider something like this: object Singleton val cls: Class[Singleton] = ??? What do I have to write instead of ????[详细]
2023-03-08 00:03 分类:问答Why do raw types in one place cause generic callsites somewhere else to be treated as raw?
Consider this example: import java.util.*; class Foo<T> { public int baz(List<String> stringlist) { return 1; }[详细]
2023-03-07 16:31 分类:问答Which guarantees do Scala's singletons have regarding serialization?
Is it safe by default, like Java\'s 开发者_JAVA技巧single-element-enum pattern or is it e. g. necessary to define readResolve or similar methods somewhere to prevent accidental or malicious breakage o[详细]
2023-03-06 11:30 分类:问答Conversion system for variants
I have written a variant class, which will be used as the main type in a dynamic language, that will ultimately allow 256 different types of value (header is an unsigned byte, only 20 are actually use[详细]
2023-03-04 09:22 分类:问答What mechanism is used to allow one to call methods defined in ruby root scope from that scope?
In ruby, when one defines a method in the root scope, it can be called from that scope: def foo \"foo\"[详细]
2023-03-03 18:40 分类:问答Building an Object System Around shared_ptr
I am using shared_ptr as my garbage collection for a toy language that I am working on which compiles to C++. My objects derive from a common base class above that there are strings and numbers then t[详细]
2023-03-02 13:27 分类:问答