[Kde-bindings] const_missing method in ruby 1.8
Alexander Kellett
lypanov at kde.org
Tue Aug 5 11:01:13 UTC 2003
On Tue, Aug 05, 2003 at 12:12:31PM +0100, Richard Dale wrote:
> On Tuesday 05 August 2003 10:37, Alexander Kellett wrote:
> > p.s: maybe this will be interesting to you:
> > http://whytheluckystiff.net/articles/2003/08/04/rubyOneEightOh
>
> Yes, it is a good read. I wonder if the matches array would be good way to
> implement the argmatch() re's in Qt.rb:
>
> [RCR:139] MatchData#captures
i've always used a different paradigm, for example:
module T # tag matchdata indices
MATCHED, BRA, CLOSING, TAG, DATA, SELF_CLOSING, KET, NEWLINE = 1,2,3,4,5,6,7,8
end
and then matches[A::TAG]
which allows for passing the matchdata around.
but. yes. captures is much nicer than the 'perl way' ;-)
(though perl can do the same as captures just by
using my ($blah) = m/blah/, iirc, though it
didn't work last time i tried)
glad it was interesting in any case ;-)
sorry for the OT ;-)
Alex
More information about the Kde-bindings
mailing list