From: John Date: 2002-07-14T03:40:07+09:00 Subject: Re: Dynamic Methods Basically I thought it was nigh impossible too. But you never know in this crazy world. I see things quite often that I didn't know where possible. Ruby has a few of those!!! Raising the too many methods error is a good solution. You can even add the methods that it matched to the exception to let the caller decide which one they would like from that list. John. "David Alan Black" wrote in message news:Pine.LNX.4.30.0207131030500.8431-100000@candle.superlink.net... > Hi -- > > On Sat, 13 Jul 2002, John wrote: > > > > (What do you propose if more than one possibility matches, by the > > > way?) > > > > Maybe to call ALL of the methods? ;-) > > Or raise TooManyMethodsError :-) > > > Must admit to not having thought of that yet. Obviously calling all of them > > is pretty weird, due to what order are they called in. > > > > Would it be possible to see if a regular expression intersects with another > > regular expression, and if so not add the one that overlaps? > > I agree with Michael that it sounds (literally, scientifically) > impossible, though living as I do under a CS glass ceiling I don't > know how the proof would go (if there is one) and would defer to more > learned opinion if said opinion were different. But still, impossible > or not, imagine being presented with: > > /(^|blah)[^\Wc-gi-z]{2,3}/ > > and > > /^...?([hi])\1/ > > and having to determine whether or not a string existed that matched > them both. "Impossible" is close enough for me :-) > > I wonder whether you could get by with a very simplified wildcard > scheme (instead of regexes) -- that might be easier to do this kind of > testing with. > > > David > > -- > David Alan Black > home: dblack@candle.superlink.net > work: blackdav@shu.edu > Web: http://pirate.shu.edu/~blackdav > >