[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gambas-devel
Subject:    Re: [Gambas-devel] libnodave
From:       Benoit Minisini <gambas () users ! sourceforge ! net>
Date:       2005-02-22 15:04:43
Message-ID: 200502221604.43798.gambas () users ! sourceforge ! net
[Download RAW message or body]

On Tuesday 22 February 2005 15:54, Rob wrote:
> On Tuesday 22 February 2005 05:51, Benoit Minisini wrote:
> > STATIC PUBLIC FUNCTION match(subject AS String, pattern AS
> > String) AS Boolean
> > Can you add a class named "Matches" with a static "_call"
> > method that implements the same behaviour ?
> > This way, for simple uses of RegExp, user will only have to
> > call:
> > IF Matches("MyString", "MyPattern") THEN ...
> > What do you think about that ?
>
> Sure, I had that in an earlier unreleased revision of the
> component.... I'll dig out my code and clean it up.
>
> Did you mean Regexp.Matches("MyString", "MyPattern") or is there
> some way I can use interpreter hooks to export the Matches
> symbol so it can be used without specifying the Regexp class?
>
> Rob
>

No, but if a class has a "_call" method, then this class can be used like a 
function.

Matches("s", "p") <=> Matches._call("s", "p").

For a simple search, I think we need a function-like class, otherwise, the 
user has to create an instance of RegExp and uses one of its method 
everytime.

Regards,

-- 
Benoit Minisini
mailto:gambas@users.sourceforge.net


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Gambas-devel mailing list
Gambas-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-devel
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic