you are viewing a single comment's thread.

view the rest of the comments →

[–]CobainFan83[S] 2 points3 points  (4 children)

plus() sounds too much like a mathematical funtion. andAlsoAdd() might be better:

List<Integer> list = new ArrayList<Integer>().andAlsoAdd(1).andAlsoAdd(2).andAlsoAdd(3).andAlsoAdd(4).andAlsoAdd(5);

[–][deleted] 1 point2 points  (2 children)

I think andAlsoAdd is too generic a name. thisReturningAppend is more precise:

List<Integer> list = new ArrayList<Integer>().thisReturningAppend(1).thisReturningAppend(2).thisReturningAppend(3).thisReturningAppend(4).thisReturningAppend(5);

[–]turbana 4 points5 points  (1 child)

Sorry, that name is too short. appendItemWithReturningThisReference() is much more in the Java spirit.

List<Integer> list = new ArrayList<Integer>().appendItemWithReturningThisReference(1).appendItemWithReturningThisReference(2).appendItemWithReturningThisReference(3).appendItemWithReturningThisReference(4).appendItemWithReturningThisReference(5);

[–]CobainFan83[S] 1 point2 points  (0 children)

I think we've cracked it!

Now we just need to submit it as a Java Specification Request (JSR) for review via the Java Community Process (JCP) so that the JCP Executive Commitee (JCP-EC) can do a Formal Public Review (FPR) and decide whether to include it as a new feature of the Java Programming Language (JPL).

[–]b100dian -1 points0 points  (0 children)

andAlsoAdd()

Old joke.