This morning on the old Caché Google Group, someone posed the following question, which I've decided to answer here, because it's interesting!
Is there a way to iterate ClassMethod's params, and get param's names and values?
The first answer I can come up with is: it's not easy! In any method, you could try to write code like this (where methodName is the name of your method):
set method = ##class(%Dictionary.MethodDefinition).IDKEYOpen($classname(), methodName)
set args = method.FormalSpec
for i=1:1:$length(args, ",") {
set arg = $piece($piece(args, ",", i), ":", 1)
write !, arg , " = ", @arg
}