Coder Social home page Coder Social logo

collection extensions about beanshell2 HOT 7 OPEN

pejobo avatar pejobo commented on July 28, 2024
collection extensions

from beanshell2.

Comments (7)

GoogleCodeExporter avatar GoogleCodeExporter commented on July 28, 2024
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 [email protected] on 9 May 2007 at 12:42

from beanshell2.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 28, 2024
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 [email protected] on 29 Mar 2008 at 1:29

from beanshell2.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 28, 2024
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 [email protected] on 29 Mar 2008 at 5:36

from beanshell2.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 28, 2024
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 [email protected] on 21 Feb 2011 at 11:25

from beanshell2.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 28, 2024
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 [email protected] on 21 Feb 2011 at 3:47

from beanshell2.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 28, 2024
> numberNames = map(entry(1, "one"), entry(2, "two"), entry(3, "three"));

vote +1

Original comment by [email protected] on 2 Mar 2011 at 8:11

from beanshell2.

GoogleCodeExporter avatar GoogleCodeExporter commented on July 28, 2024
> numberNames = map(entry(1, "one"), entry(2, "two"), entry(3, "three"));

vote +1

numbers = list( 1, 2, 3 );

vote +1

Original comment by [email protected] on 29 May 2011 at 9:42

from beanshell2.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.