From: Matthew Smillie Date: 2005-12-06T10:37:46+09:00 Subject: Re: Are my metaprogramming underpants showing? On Dec 6, 2005, at 0:03, James Britt wrote: > Matthew Smillie wrote: >> Hello all, > ... > >> In general I'm asking (like the subject suggests) if my >> metaprogramming underpants are showing? Have I defied any >> particular conventions? Does this seem like a sensible approach, >> and if so, a sensible implementation? Have I set myself up for >> some rather spectacular failures? >> Specifically, though, there are three aspects of the code that >> I'm particularly curious whether anyone has any alternate >> approaches: > > > A suggestion: move the code that munges method_id and *params into > separate methods. Much easier to test and make sure it does what > you want and that it doesn't barf on weird input. Done, with a due sense of embarrassment since I as soon as I started thinking about that aspect of the code, I immediately found a bug involving using capitalize/downcase and flickr's camelCase method names. Whoops & thanks for the reminder (I'll flatter myself that I would have caught that during refactoring and testing anyway). While I appreciate the input, I'm not particularly worried about weird input and barfing at this stage, rather that my overall approach with the metaprogramming is relatively sane. I've barfed over lots of weird input in my time (mixing wine and spirits, for instance), but the metaprogramming is relatively new. thanks again, matthew smillie.