questions on PhanTango 'merger' (was Merging Tangobos into Tango) - long-term vision
Yigal Chripun
yigal100 at gmail.com
Wed Oct 10 15:49:21 PDT 2007
BCS wrote:
>
> Where the "OO is god" (oops, make that "good") stance puts me off is
> where it get in my way with things like (random example) RegEx. I don't
> want to new of an object and fill in all the members (etc, etc) just to
> run one regex match and then drop the object. I'd love to have both a
> RegEx class then compiles to some sort of fast state machine and a free
> function that does an on the fly interpretation.
>
> Before you even say it; That is a totally impractical way to do it. Why
> have two totally independent code bases doing (almost) exactly the same
> thing? At this point I'm just stating what I think would be ideal, not
> what I expect to get.
>
>
> I know that's all a bit disjointed, but I hope it shows something of my
> reservations of switching to Tango.
>
if i understand you correctly what you ask for is an implementation of
regEx as in Ruby.
Ruby is totally OOP and RegEx is OOP based so we have classes an such to
represent the expression and the results, etc..
on top of it it implement an interface wich allows you to use regEx as
you would normally expect (like in perl. for example you can use literal
expressions like /pattern/). most of the time people use that. you can
use the underlying classes if you want but that of course is more
verbose (and probably most of the time is not needed).
This is much better than two code bases, it gives us the benefits of
both styles and i think that's what lars suggests.
the only thing left to do is figure out how a similar structure could be
implemented in D.
More information about the Digitalmars-d
mailing list