One more thing out of the category "Java annoys me": In Java you can declare an array like that:
String[] array_of_strings = { "foo", "bar", "baz" };
but you can't do that inside a func call
someMethod({ "foo", "bar", "baz" });
not even when using an explicit cast
someMethod((String[]){ "foo", "bar", "baz" });
A smart compiler should be able to create the same code for both, I agree this can be unreadable, but that should be my choice not the language's choice.</flame>
Sunday, May 4. 2008 at 00:15 (Link) (Reply)
http://phpfi.com/314360
Sunday, May 4. 2008 at 00:34 (Reply)
Thursday, August 28. 2008 at 17:05 (Reply)
public T[] array(T... array) { return array; }
}
----
import static PHPify.array;
// ...
String[] foo = array("foo", "bar", "baz");
someMethod(array("foo", "bar", "baz"));
Bitteschön ... Generics, Varargs, Static Imports - wenn du auf die PHP-Syntax stehst.