in reply to Re: Arrays of circular memory references
in thread Arrays of circular memory references

Thank you Athanasius! It does help. I'm working on a molecular object system (atoms, molecules, bond, angles, dihedrals, etc). The work has turned out to be something of a conceptual cleanser, and this is a good example. From the perspective of atoms and bonds in molecules, placing atoms into bonds that have bond methods and attributes is clear, and then having the atoms know that they are bonded seems intuitive from a chemical perspective. BUT, maybe not. The circular dependency makes everything more difficult when bonds break, which was what I was wrestling with and why I posted the question. The design is cleaner if the atoms don't know... leave it to the molecules to give that information with, perhaps, eventual extensions to Forest::Tree graphs of bonding patterns.
  • Comment on Re^2: Arrays of circular memory references

Replies are listed 'Best First'.
Re^3: Arrays of circular memory references
by Anonymous Monk on Aug 26, 2013 at 14:16 UTC

    If you just need to know when an atom is bonded or not, why not make the Bond() and UnBond() functions increment/decrement a bond counter on the involved atoms?

      Thanks! That would be really useful.