On Wednesday, 18 April 2012 at 05:45:06 UTC, Jakob Ovrum wrote:
> On Tuesday, 17 April 2012 at 15:36:39 UTC, Ali Çehreli wrote:
>>
>> The reason is, a sequence of UTF-8 code units are not a valid
>> UTF-8 when reversed (or retro'ed :p). But a dchar array can be
>> reversed.
>>
>> Ali
>
> It is abs
On Tuesday, 17 April 2012 at 15:18:49 UTC, bearophile wrote:
Jakob Ovrum:
return array(strippedTail);
}
The type of the return expression is dstring, not string.
What is the most elegant way or correct way to solve this
friction?
(Note: the function is used in CTFE)
On Tuesday, 17 April 2012 at 15:36:39 UTC, Ali Çehreli wrote:
The reason is, a sequence of UTF-8 code units are not a valid
UTF-8 when reversed (or retro'ed :p). But a dchar array can be
reversed.
Ali
It is absolutely possible to walk a UTF-8 string backwards.
The problem here is that arr
On 04/17/2012 09:12 AM, Timon Gehr wrote:
> On 04/17/2012 06:09 PM, Ali Çehreli wrote:
>> The algorithm must be building a local string.
> It does not have to build a local string, see
> http://dlang.org/phobos/std_utf.html#strideBack
I never said otherwise. :p
I was too lazy to locate where 2
On 04/17/2012 06:09 PM, Ali Çehreli wrote:
On 04/17/2012 08:58 AM, bearophile wrote:
> Ali Çehreli:
>
>> The reason is, a sequence of UTF-8 code units are not a valid UTF-8
>> when reversed (or retro'ed :p).
>
> But reversed(char[]) now works :-)
That's pretty cool. :) (You meant reverse()
On 04/17/2012 08:58 AM, bearophile wrote:
> Ali Çehreli:
>
>> The reason is, a sequence of UTF-8 code units are not a valid UTF-8
>> when reversed (or retro'ed :p).
>
> But reversed(char[]) now works :-)
That's pretty cool. :) (You meant reverse()).
Interesting, because there could be no other w
Ali Çehreli:
The reason is, a sequence of UTF-8 code units are not a valid
UTF-8 when reversed (or retro'ed :p).
But reversed(char[]) now works :-)
Bye,
bearophile
On 04/17/2012 08:12 AM, Jakob Ovrum wrote:
> Consider this simple function:
>
> private string findParameterList(string typestr)
> {
> auto strippedHead = typestr.find("(")[1 .. $];
> auto strippedTail = retro(strippedHead).find(")");
>
> strippedTail.popFront(); // slice off closing parenthesis
>
Jakob Ovrum:
return array(strippedTail);
}
The type of the return expression is dstring, not string.
What is the most elegant way or correct way to solve this
friction?
(Note: the function is used in CTFE)
Try "text" instead of "array".
Bye,
bearophile
Consider this simple function:
private string findParameterList(string typestr)
{
auto strippedHead = typestr.find("(")[1 .. $];
auto strippedTail = retro(strippedHead).find(")");
strippedTail.popFront(); // slice off closing parent
10 matches
Mail list logo