leon breedt ha scritto: > Hi, > > Any reason why syntax like this: > > def prefix_/(a-zA-Z0-9_)/(suffix, *args) > do something with suffix > end > > Would be worse than doing manual dispatching in method_missing? > > Seems like it could be a nifty hack at first glance, makes dynamic > methods slightly more explicit (and a bit more intellisense friendly). > #respond_to? could be automatically taught this as well, no? > IMO, it would be cool to have multiple dispatch based on ===, so that you could write def m(s) :default end def m(/:alpha:/ s) :alphabetic end it would be nice even because all methods such as def m(x) conditional branch other branch other branch end could be splitted in many different cases. Just think of what ActiveRecord::Base#find does to get why this would be nice ;)