On Mon, Jan 19, 2009 at 11:59 AM, Chouser <chou...@gmail.com> wrote: > > On Sat, Jan 17, 2009 at 8:03 PM, pc <peng2che...@yahoo.com> wrote: >> >> This is very useful. For me it was useful to be able to limit the >> output to lines that contained a few selected letters. >> >> (show String "pper") >> === public final java.lang.String === >> [82] toUpperCase : String () >> [83] toUpperCase : String (Locale) >> nil > > This is a good idea, thanks. I've got a version here that allows > a full regex match, and is by default case-insensitive. I think both > these are good. > > But my version also only allows matches on the method name (not on > return value or argument class names). At first I thought this was > also good, but now I'm less sure. How often do you think you'd want > to be able to search on a method's argument names, vs. how many > unhelpful matches you'd get doing (show String "string") ? Opintions? > > --Chouser >
My feeling is that you'd want to search on arguments infrequently enough compared to searching on method name that its worth defaulting to only search on the method name. For the case where you might want to search on method names maybe we could look at some sort of composable approach. I'm thinking along the lines of the Unix pipeline approach. Extremely rough pseudo-code of what I'm getting at: (-> (show String "case") (grep "locale")) to find the methods containing the regexp 'case' and then further constraining that to those entries that match the regexp 'locale'. I've also assumed case insensitivity here as I think that makes sense in this context. Then again maybe this is a classic case of overdesign. Perhaps it is easier in the short term to just be pragmatic and create an overload for show that accepts a third argument to search on argument/return names and types: (show String "case" "locale") or: (show String "*" "locale") for all methods dealing with arguments or return types of locale or arguments named locale. /mike. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~----------~----~----~----~------~----~------~--~---