Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Java question

Name: Anonymous 2007-06-21 22:57 ID:73D09MUE

I need to be able to associate one or more values with a key, and so far I've looked at maps, sets, treemaps, and vectors, but none of them can do what I need to do. Could someone point me in the right direction (besides "LOL USE PYTON LULZ" or "Kill yourself").

Name: Anonymous 2007-06-21 23:05 ID:cSLw5/bU

Read SICP.

Name: Anonymous 2007-06-21 23:06 ID:akf0VcPT

HashMap<TKey, List<TValue>> you_are_an_idiot;

Name: Anonymous 2007-06-22 3:13 ID:XrsEXTNb

Wrong.

HashMap<TKey, List<TValue> >

Notice what is missing in yours?

Name: Anonymous 2007-06-22 3:36 ID:hnykqDyT

>>4
This isn't C++. Java knows how to tell the difference between a bitwise shift and nested generics.

Name: Anonymous 2007-06-22 3:55 ID:kjk5hVtW

>>4
lol for C++ syntax whore

Name: Anonymous 2007-06-22 5:49 ID:V2WIfkKu

>>1
Kill yourself, then use Python.

Name: Anonymous 2007-06-25 22:14 ID:1lqr/hre

Yeh

Name: Anonymous 2007-06-25 23:29 ID:N+dkuxQu

declaration:
Map<K,Collection<TValue>> map = new HashMap<TKey,Collection<TValue>>();

helper method so you don't need to care about creating the collections:
private <K,V> Collection<V> mapCollection(Map<K,Collection<V>> map, K key) {
  Collection<V> c = map.get(key);
  if(c == null) map.put(key,c = new ArrayList<V>());
  return c;
}


java *fapfafap*

Name: Anonymous 2007-06-26 10:47 ID:f/5KKa7x

The big point is, why are the C++ and Java morons such losers? They make an endless chain of mistakes.

They lack proper dynamic typing in their languages, and to fix this fuckup, they introduce even more fuckup, language bloat, and enterprise hell.

Then they go defining stupid syntaxes and operators such as <...>. Who the hell uses <...> in a language that already uses < and >? How can you tell in >>9 if Map<K means to evaluate whether object Map is lesser than object K? Or is it that the language is so limited that you can't attempt to compare two any objects, or somethings are not even objects? Way to lose, motherfuckers.

If you want to introduce this generic shit because your type system is so big a failure, better define macros. And for that, you already have all the syntax you need. You can use:

defmacro(
...
);

and not bloat the language. Stop fixing shitty decisions with even shittier decisions.

Name: Anonymous 2007-06-26 10:53 ID:f/5KKa7x

>>10
any two objects, or some things are not even objects?
Fixing, I was writing too fast out of EXPERT LISPER RAGE.

Name: Anonymous 2007-06-26 11:23 ID:eEXJ6Vg9

>>10

No, if you want this generic shit with an static type system, do it the haskell way. it's better.
that said, dynamic typing + defmacro ftw

Name: Anonymous 2007-06-26 11:47 ID:XwSbe+e0

How can you tell in >>9 if Map<K means to evaluate whether object Map is lesser than object K?

by not being retarded

Name: Anonymous 2007-06-26 12:09 ID:Heaven

How can you tell in >>9 if Map<K means to evaluate whether object Map is lesser than object K?
Because the syntax distinguishes between declarations and expressions.

Name: Anonymous 2007-06-26 12:51 ID:f/5KKa7x

>>14
the syntax distinguishes between declarations and expressions
Then this syntax is a FAILURE OF EPIC PROPORTIONS.

Name: Anonymous 2007-06-27 1:40 ID:NKIY8Q5r

>>14
That reeks of Basic's "If n = 3 Then n = 4" shite.

Name: Anonymous 2007-06-27 4:07 ID:Heaven

lol @ modal syntax

Name: Anonymous 2009-08-16 23:05

Lain.

Name: Anonymous 2010-11-28 5:42

Name: Anonymous 2010-12-17 1:40

Erika once told me that Xarn is a bad boyfriend

Name: Anonymous 2011-02-02 23:33

Name: Anonymous 2011-02-17 20:12

check 'emNewer Posts
Don't change these.
Name: Email:
Entire Thread Thread List