Hi Bob and others, currently it can be difficult to get/set elements within a multi-level nested array/hash data structure in Jmol depending on the context.
Example data structure: x = {"a": {"1": ["x", "y", "z"], "2": ["I", "II"]}} And there is also the ambiguity of an expression like 'x[1][3]' which might mean element '1' to '3' or even character '1' to '3' instead of element '3' of element '1' of array 'x'. Q: What would you think about implementing the Perl "arrow" syntax (using "->", see example below) as an alternative syntax for accessing nested data structures? Example Perl syntax for accessing the element with value "II" from the example above: x["a"]->[2]->[2] In Perl I frequently use data structures with five or more levels, for example as output from an XML parser. There this syntax helps to make the code much better readable. And it sometimes also assists the Perl parser to interpret code as intended. As far as I know, "->" is not used yet within Jmol. So it shouldn't collide with any existing syntax. Regards, Rolf -- Rolf Huehne Postdoc Leibniz Institute for Age Research - Fritz Lipmann Institute (FLI) Beutenbergstrasse 11 07745 Jena, Germany Phone: +49 3641 65 6205 Fax: +49 3641 65 6210 E-Mail: rhue...@fli-leibniz.de Website: http://www.fli-leibniz.de Scientific Director: Prof. Dr. K. Lenhard Rudolph Head of Administration: Dr. Daniele Barthel Chairman of Board of Trustees: Dennys Klein VAT No: DE 153 925 464 Register of Associations: No. 230296, Amtsgericht Jena Tax Number: 162/141/08228 ------------------------------------------------------------------------------ Dive into the World of Parallel Programming The Go Parallel Website, sponsored by Intel and developed in partnership with Slashdot Media, is your hub for all things parallel software development, from weekly thought leadership blogs to news, videos, case studies, tutorials and more. Take a look and join the conversation now. http://goparallel.sourceforge.net/ _______________________________________________ Jmol-developers mailing list Jmol-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jmol-developers