Hi again Petya.
To list sequence diagrams for a class, you can use one of the solutions in this post: "Report on specific package: Outer access".
Your code needs square brackets around the names of the collections:
if ($name of [classes] = $name of [classifierRole] -> [formalClassifier]) then $name else " "
But I'm sure you've solved that for yourself by now!
However, I doubt that's going to achieve what you want: $name of [classes] will return a comma-separated list of the names of every class. If this is still of interest to you, could you explain what you were trying to achieve, and I'll see if I can suggest a way to achieve it.
best regards,
Simon