Java Mailing List Archive

http://www.gg3721.com/

Home » user.groovy »

RE: [groovy-user] Safe dereference for nested maps

Alexander Veit

2008-08-24

Replies: Find Java Web Hosting

Author LoginPost Reply
> pexatus wrote:
> I want to use the safe dereference operator, but it does not
> work with the subscript operator. In other words, I want
> to do this;
>
> if (map['a']?['b'] != null) {
>  // process map['a']['b']
> }

Hm, I wonder what would happen with

assert ["1":["de":"eins", "en":"one"]]["2"]?["en"] : "not in map"

if the language would support such an operator :)

--
Alex


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

  http://xircles.codehaus.org/manage_email


©2008 gg3721.com - Jax Systems, LLC, U.S.A.