Top "Language-design" questions

A tag for questions related to the design of any aspect of programming languages.

Calling Java varargs method with single null argument?

If I have a vararg Java method foo(Object ...arg) and I call foo(null, null), I have both arg[0] …

null language-design java variadic-functions
Why is there "data" and "newtype" in Haskell?

It seems that a newtype definition is just a data definition that obeys some restrictions (e.g., only one constructor), …

haskell types language-design type-systems
Why can't Java constructors be synchronized?

According to the Java Language Specification, constructors cannot be marked synchronized because other threads cannot see the object being created …

java constructor language-design synchronized
Lua operators, why isn't +=, -= and so on defined?

This is a question I've been mildly irritated about for some time and just never got around to search the …

lua language-design assignment-operator compound-assignment
Why can't C# member names be the same as the enclosing type name?

In C#, the following code doesn't compile: class Foo { public string Foo; } The question is: why? More exactly, I understand …

c# language-design
Why doesn't Java allow generic subclasses of Throwable?

According to the Java Language Sepecification, 3rd edition: It is a compile-time error if a generic class is a direct …

java generics exception language-design
Purpose of Scala's Symbol?

Possible Duplicate: What are some example use cases for symbol literals in Scala? What's the purpose of Symbol and why …

scala syntax language-design symbols literals
Why function template cannot be partially specialized?

I know the language specification forbids partial specialization of function template. I would like to know the rationale why it …

c++ language-design template-specialization partial-specialization function-templates
Python: What's the difference between __builtin__ and __builtins__?

I was coding today and noticed something. If I open a new interpreter session (IDLE) and check what's defined with …

python python-3.x python-2.7 language-design python-module
PHP global in functions

What is the utility of the global keyword? Are there any reasons to prefer one method to another? Security? Performance? …

php language-design