Rolf, thank you for exercising the hash business and giving such excellent
examples of the problems. Keep them coming!
Jmol.___JmolVersion="14.3.13_2015.04.01b"
bug fix: hash values created from named int variables do not clone properly
bug fix: hash[key1]..key2.push() does not work properly
bug fix: local var xxx with same name of ..xxx forces lower case xxx
bug fix: show hash where one of the elements is an empty hash ignores that
key
http://chemapps.stolaf.edu/jmol/zip/jmol-14.3.13_2015.04.01b.zip
On Wed, Apr 1, 2015 at 11:25 AM, Rolf Huehne <[email protected]> wrote:
> Hi all,
>
> I thought that numeric and string variable values are copied directly in
> a variable assignment and not by reference.
> But in Jmol 14.3.13_2015_04_01 this doesn't seem to be true.
>
> In the following example only the string variable value seems to be
> copied directly, not the value from the numeric variable:
>
> ----- Example --------
> function referenceTest() {
> var testHash1 = {};
> var testHash2 = {};
> for (var i=1; i<3; i++) {
> testHash1[i] = {"i": i};
> var stringI = "val" + i;
> testHash2[i] = {"stringI": stringI};
> }
> print testHash1;
> print testHash2;
> }
> referenceTest;
>
> ----- Example Output -----
> {
> 1 :
> {
> i : 3
> }
> 2 :
> {
> i : 3
> }
> }
> {
> 1 :
> {
> stringI : "val1"
> }
> 2 :
> {
> stringI : "val2"
> }
> }
>
> --------------------------
>
> Q: Is this behavior intended or a bug?
>
> Q: If it is intended, how can I get the actual numeric value into the hash?
>
> 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: [email protected]
> 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-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/jmol-users
>
--
Robert M. Hanson
Larson-Anderson Professor of Chemistry
Chair, Department of Chemistry
St. Olaf College
Northfield, MN
http://www.stolaf.edu/people/hansonr
If nature does not answer first what we want,
it is better to take what answer we get.
-- Josiah Willard Gibbs, Lecture XXX, Monday, February 5, 1900
------------------------------------------------------------------------------
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-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-users