Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #34301

Re: hashtables syntax

From Eric Sosman <esosman@comcast-dot-net.invalid>
Newsgroups comp.lang.java.programmer
Subject Re: hashtables syntax
Date 2016-05-16 07:48 -0400
Organization A noiseless patient Spider
Message-ID <nhcbrv$7qk$1@dont-email.me> (permalink)
References <nh954m$bu8$1@reader1.panix.com> <nh9n7r$ira$1@dont-email.me> <338d0b8c-9a5e-ccc0-9a5c-792c870f84bf@mrbrklyn.com>

Show all headers | View raw


On 5/16/2016 1:26 AM, ruben safir wrote:
> On 05/15/2016 07:44 AM, Eric Sosman wrote:
>> y "template" I guess you mean the <> angle braces?  That's where
>> the type parameters would go, just as in the declaration.  In fact, it
>> would be perfectly legal to repeat the parameters -- but since Java can
>> figure them out for itself ("Hmmm: They're probably the same types as
>> I already saw when `functions' was first declared!"), why bother?
>
>
> Gotchya, but it seems inconsistent.
>
>
> why not like
>
> HashMap<> function = new HashMap<String, Type[]>

     With what is this "inconsistent?"  I'm not seeing your point.

     The types must be specified on one side or the other; Java
decided to insist that they appear on the left.  Java *could*
have chosen to have them on the right (I suppose, but there may
be considerations I'm unaware of), but it chose the left.  Shrug.

     Bear in mind that when type arguments first arrived in Java
they had to appear on *both* sides!  Count your blessings.

> Why declare function as a type at all.

     Not sure what you mean here.  Every identifier in Java has a
type, and when you introduce a new identifier you must tell the
compiler what type it has.  Why should `function' be unlike all
other identifiers?

     Or maybe you think Java shouldn't be a typed language?  Sorry;
that ship sailed long, long ago.

-- 
esosman@comcast-dot-net.invalid
"Don't be afraid of work. Make work afraid of you." -- TLM

Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

hashtables syntax Popping mad <rainbow@colition.gov> - 2016-05-15 06:31 +0000
  Re: hashtables syntax Lew <lewbloch@gmail.com> - 2016-05-14 23:52 -0700
    Re: hashtables syntax Popping mad <rainbow@colition.gov> - 2016-05-15 10:23 +0000
      Re: hashtables syntax Lew <lewbloch@gmail.com> - 2016-05-15 09:33 -0700
        Re: hashtables syntax Lew <lewbloch@gmail.com> - 2016-05-15 09:35 -0700
      Re: hashtables syntax Eric Douglas <e.d.programmer@gmail.com> - 2016-05-16 06:10 -0700
  Re: hashtables syntax Eric Sosman <esosman@comcast-dot-net.invalid> - 2016-05-15 07:44 -0400
    Re: hashtables syntax ruben safir <ruben@mrbrklyn.com> - 2016-05-16 01:26 -0400
      Re: hashtables syntax Eric Sosman <esosman@comcast-dot-net.invalid> - 2016-05-16 07:48 -0400
        Re: hashtables syntax Steven Simpson <ss@my.domain.invalid> - 2016-05-16 15:51 +0100
          Re: hashtables syntax Steven Simpson <ss@my.domain.invalid> - 2016-05-16 22:35 +0100
      Re: hashtables syntax Lew <lewbloch@gmail.com> - 2016-05-16 16:10 -0700
  Re: hashtables syntax Andreas Leitgeb <avl@logic.at> - 2016-05-15 13:43 +0000
  Re: hashtables syntax Roedy Green <see_website@mindprod.com.invalid> - 2016-05-20 18:00 -0700

csiph-web