Open GoogleCodeExporter opened 9 years ago
Very good idea. this would be very useful.
However I suggest that language enhancements, espeically ones that dont conform
to
java specs, be either defered or in a new fork/branch.
Original comment by dlee.cal...@gmail.com
on 9 May 2007 at 12:42
I can see how this syntax would be useful and convenient. However, Beanshell
is a
java-like language, and I don't think that it is such a good idea to be adding
non-java syntax.
Original comment by moor...@gmail.com
on 29 Mar 2008 at 1:29
I agree that adding a lot of non-java syntax is a bad idea. But the 2 global
methods
I suggested here, list() and map(), are possible without any syntax additions
as long
as we have varargs, which is part of java since jdk 1.5 . The only addition to
syntax which is suggested is a "=>" binary operator to create Map.Entry
objects. And
this is very minor addition, just one more binary operator.
Original comment by fschm...@gmail.com
on 29 Mar 2008 at 5:36
Perhaps another command ("pair(key, value)") would be sufficient?
Than you could do
numberNames = map(pair(1, "one"), pair(2, "two"), pair(3, "threee"));
No new symbols ;)
Original comment by pejob...@gmail.com
on 21 Feb 2011 at 11:25
That works but maybe entry is better than pair() as in:
numberNames = map(entry(1, "one"), entry(2, "two"), entry(3, "three"));
Original comment by fschm...@gmail.com
on 21 Feb 2011 at 3:47
> numberNames = map(entry(1, "one"), entry(2, "two"), entry(3, "three"));
vote +1
Original comment by pejob...@gmail.com
on 2 Mar 2011 at 8:11
> numberNames = map(entry(1, "one"), entry(2, "two"), entry(3, "three"));
vote +1
numbers = list( 1, 2, 3 );
vote +1
Original comment by javadba@gmail.com
on 29 May 2011 at 9:42
Original issue reported on code.google.com by
fschm...@gmail.com
on 9 May 2007 at 2:19