Are there equivalents to Ruby's method_missing in other languages?

前端 未结 15 1672
渐次进展
渐次进展 2020-12-08 08:00

In Ruby, objects have a handy method called method_missing which allows one to handle method calls for methods that have not even been (explicitly) defined:

15条回答
  •  星月不相逢
    2020-12-08 08:57

    Tcl has something similar. Any time you call any command that can't be found, the procedure unknown will be called. While it's not something you normally use, it can be handy at times.

提交回复
热议问题