Oh, I mistyped. I did not mean to add that colon. Use of "*" and/or "," leads to copying, but we may want to rethink how that works. *only that level* is copied. If there are references in there to deeper levels, those levels are not copied. I have to think if there is a straightforward way to do a deep copy. Right now it's a bit of a mixture.
Bob On Fri, Sep 18, 2015 at 9:28 AM, Robert Hanson <hans...@stolaf.edu> wrote: > Hmm. Curious. I will check to see what is going on there. > > On Thu, Sep 17, 2015 at 9:11 AM, Rolf Huehne <rhue...@fli-leibniz.de> > wrote: > >> On 09/16/2015 08:27 PM, Robert Hanson wrote: >> > Use of "*:"or "," does result in copying. Use of the actual key does >> not: >> > >> > $ x = { "b": 4,"a": 3,"d": { "d2": 4,"d1": 3333 },"c": 5 } >> > $ y = x.d >> > $ y.d1 = 0 >> > $ print x.format("JSON") >> > >> > *{ "b": 4,"a": 3,"d": { "d2": 4,"d1": 0 },"c": 5 }* >> > $ y = x.select("d,") >> > $ y.d1 = -1 >> > $ print x.format("JSON") >> > >> > *{ "b": 4,"a": 3,"d": { "d2": 4,"d1": 0 },"c": 5 }* >> > >> I would rather need '**:' (or '**,'?) but both give an empty result in >> the old and the new syntax: >> >> ----- Example ----------------------------------------------------- >> globalHash = [subsets: [subset1: [atomInfos: [atom1: [seqNum: 1], >> atom2: [seqNum: 2], >> atom3: [seqNum: 3] >> ] >> ], >> subset2: {}, >> subset3: {} >> ] >> ]; >> >> filter = "[SELECT **: WHERE seqNum > 1]"; >> globalHash..subsets..subset2..atomInfos = >> getProperty(globalHash..subsets..subset1..atomInfos, filter); >> >> filter = "**: WHERE seqNum > 1"; >> globalHash..subsets..subset3..atomInfos = >> globalHash..subsets..subset1..atomInfos.select(filter); >> >> print globalHash..subsets >> >> ----- Example output --------------------------------------------- >> { >> "subset1" : >> { >> "atomInfos" : >> { >> "atom1" : >> { >> "seqNum" : 1 >> } >> "atom2" : >> { >> "seqNum" : 2 >> } >> "atom3" : >> { >> "seqNum" : 3 >> } >> } >> } >> "subset2" : >> { >> "atomInfos" : "" >> } >> "subset3" : >> { >> "atomInfos" : "" >> } >> } >> ------------------------------------------------------------------ >> >> 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 >> >> >> >> ------------------------------------------------------------------------------ >> Monitor Your Dynamic Infrastructure at Any Scale With Datadog! >> Get real-time metrics from all of your servers, apps and tools >> in one place. >> SourceForge users - Click here to start your Free Trial of Datadog now! >> http://pubads.g.doubleclick.net/gampad/clk?id=241902991&iu=/4140 >> _______________________________________________ >> Jmol-users mailing list >> Jmol-users@lists.sourceforge.net >> 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 > > -- 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
------------------------------------------------------------------------------
_______________________________________________ Jmol-users mailing list Jmol-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jmol-users