[Gambas-devel] gb3 Split() problem

Toni arosa at ...615...
Mon Jan 4 14:53:47 CET 2010


I have been following this discussion thread with interest. Let me give 
you my 5 cents about it...

I am sure that if "Separators" parameter in Split was an array of single 
chars (I guest that is "byte" in Gambas), then it would cristal clear 
that each char is a separator by itself ...  But to me, one of the main 
benefits about using Gambas is such this kind simplifications.
 
On the other hand I agree with Kadaitcha Man that it would be nice being 
able to use a multiple char separator  ( aka. string separators with a 
length > 1) in gb3.

Regards,

En/na Benoît Minisini ha escrit:
>> 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,
>
>   

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/devel/attachments/20100104/3279de71/attachment.html>


More information about the Devel mailing list