[Gambas-devel] gb3 Split() problem

Benoît Minisini gambas at ...1...
Mon Jan 4 14:31:14 CET 2010


> 2010/1/4 Benoît Minisini <gambas at ...1...>:
> > No, you can have several different separators. Each character in the
> > "Separators" is a possible separator. This is the reason why Separator is
> > written in the plural.
> 
> Hang about...
> 
> Are you saying that if the Separators are defined as "aZ" then "a" and
> "Z" are two different separators?

Yes!

> 
> If so, why is Separator defined as a string, which is a sequence of
>  characters?

Because then the function is faster.

> 
> If "aZ" is a string then it is a string, not two individual characters
> meaning two different things. That is,"aZ" means exactly that "aZ",
> not "a" OR "Z".
> 
> A string comprising "aZ" is not "a" or "Z", it is "aZ", end of story.
> But if you say that "aZ" defines two distinct separators then "a" is
> Char and "Z" is Char, and gb does not have a Char type.

One more reason to use a string instead of, well, an array of Byte for 
example.

> 
> There is a serious logic problem here, Benoit.
> 

I don't see the relation with logic. The function works that way, and it is 
documented that way. Maybe the syntax is not 100% Bjarne Stroustrup compliant, 
but the goal was having a little function for splitting that is fast, small, 
and that fits 90% of the programmer needs.

> I'm sorry to ruin your introduction to 2010, but these are genuine
> problems that need to be dealt with if you want gb3 to be released to
> the unthinking masses this year.

I don't think that Split() is the problem in Gambas 3!

> 
> I might suspect that you are using regex to simply solve a complex
> problem but I wouldn't come right out and say such a thing, hey.
> 

I've never used any regex in my Gambas program until now, so I'm fine.

Regards,

-- 
Benoît Minisini




More information about the Devel mailing list