Menu

#575 info class forward returning error instead of empty list

open
5
2010-01-22
2010-01-20
dzach
No

[info class forward className methodName] returns an error "prefix argument list not available for this kind of method" when it is used on a methodName that has no forward defined for it.

The documentation states:
"info class forward class method
This subcommand returns the argument list for the method forwarding called method that is set on the class called class. "

So, one would expect to get an empty list if there is no forward defined for a class, since there is no other way of introspecting a class method for any forwards.
The error given cannot be remedied by the programmer, since there is nothing one can do but use an unecessary [catch] to avoid it. Not having a forward is not an error for a method.

An empty list would convey the same meaning with the error message, i.e. the unavailability of an argument list, but in a non-exceptional manner.

Discussion

  • dzach

    dzach - 2010-01-21

    Or, should there be another way to enumerate a class's 'forwards', without being punished with an error?

     
  • Donal K. Fellows

    • labels: 1024516 --> 35. TclOO Package
    • milestone: 897103 -->
     
  • Donal K. Fellows

    Everything is as designed and documented, and there's consistency with [info class definition] which only applies to methods defined with 'method'.

    Whether or not it should be an error is a separate matter. Converting to FRQ.