I guess you’re right. It’s just this particular function is of low interest to me I picked it because of this post thinking it’s of some importance since it’s been discussed before. My very initial motivation was this usage and there my first design was very similar to the alternate function
#let my-counter = counter("my-counter")
#let k = 1
#let group(it) = {
context {
let value = my-counter.get().first()
if value==k{
hide(it)
}
else{
it
}
}
my-counter.step()
}
This function suffers from that same problem with attachments. This particular usage with manim gives natural examples of the use outside of math context e.g.
#group[= Introduction]
...
But maybe if I combined these two approaches making 2 functions and using this one only if there’s an attachment it would make more sense than trying to write one huge function for each edge case.