I've written patches with clones where each clone needed to know:
[1] how many siblings it had
[2] data from its preceding and following clone
[3] whether the preceding or following clone exists
To do [1], I've had each clone send its instance number ($1) to a known global destination. Since it appears that clones are created in ascending order, this works as long as you adjust for the start index (again, something that clones don't automatically just know). I haven't found anything that says this creation order is specified, nor have I found a way to set the number of clones from some external value, so I regard my solution to be a hack. Can I count on this order, or should I use [max] on every incoming instance number?
For [2], I've used [value] with identifiers that include each clone's instance number. It's a small PITA when accessing other sibling's values because you can't do arithmetic on the instance number in the preprocessor; you have to make it explicit, e.g.
The last is similar to [2], except that I just initialize a "clone$1exists" value to 1. It appears that if you ask PD for a value that doesn't exist, it returns 0.
Are there better ways to do these things that don't require manual housekeeping or rely on undocumented features?