News for hackers. Stuff that matters.
Re:Perl 11 by lmm on Wednesday October 24, 2018 @04:54AM (#18290756)
In java you have to call the special and awkward .newInstance rather than being able to use standard "new". Whereas in e.g. Python I can equally well do

    >>> str("foo")
    'foo'
    >>> x = str
    >>> x("foo")
    'foo'
and the "builtin" str and "userspace" x are equally first-class.
Re:Perl 11 by kazagistar on Wednesday October 24, 2018 @11:15AM (#18293131)
Sure, the ergonomics are different. One is a statically compiled language and one is dynamic. But it's still an object.
Re:Perl 11 by lmm on Wednesday October 24, 2018 @12:02PM (#18293607)
If I write

    new String("foo");
in Java, how do I get an object that can take the place of String in that expression? String.class has some relationship with the "String" in the code I quoted, but it's not the same thing; the thing that I apply new to is not a thing I can call methods on, and the thing that I can call methods on is not a thing I can apply new to.