Thread overview
Compile time string manipulation caveats
Feb 24, 2007
Hasan Aljudy
Feb 24, 2007
Gregor Richards
Feb 25, 2007
Hasan Aljudy
Feb 25, 2007
Hasan Aljudy
February 24, 2007
I discovered that compile-time functions can't use non-static arrays .. implying that we can't use char[] which is a dynamic array.
However, this is essential for any non-trivial string parsing (even for trivial ones, in fact), so how do we overcome this problem?

February 24, 2007
Hasan Aljudy wrote:
> I discovered that compile-time functions can't use non-static arrays .. implying that we can't use char[] which is a dynamic array.
> However, this is essential for any non-trivial string parsing (even for trivial ones, in fact), so how do we overcome this problem?
> 

Uh, compile-time functions /can/ use dynamic arrays.

 - Gregor Richards
February 25, 2007

Gregor Richards wrote:
> Hasan Aljudy wrote:
>> I discovered that compile-time functions can't use non-static arrays .. implying that we can't use char[] which is a dynamic array.
>> However, this is essential for any non-trivial string parsing (even for trivial ones, in fact), so how do we overcome this problem?
>>
> 
> Uh, compile-time functions /can/ use dynamic arrays.
> 
>  - Gregor Richards

oh, sorry my mistake,
I had a piece of code which was refusing to be compile-time executed, I didn't see anything wrong with it, but then I saw this:
------------
expressions in the function may not:
    * use pointers, delegates, *** non-const arrays ***, structs, unions or classes
------------
and thought that was causing the problem ...

It turned out that I had a line:
if( result != "" )
which was causing the problem, I changed it to
if( result.length > 0 )
and my function was executing at run-time now!


February 25, 2007

Hasan Aljudy wrote:
> and my function was executing at run-time now!

I mean compile time ..