|
![](/i/fill.gif) |
Felix Wiemann wrote:
> #debug concat("POV")
>
> works fine, but the doc says:
>
> concat(S1,S2,...)
>
> IMO the doc and not the function should be changed because this is a useful
> feature ...
I agree this is a useful feature, although for different reasons.
Consider the following macro:
#macro reverse_string (s)
concat(
""
#local j=strlen(s);
#while (j>0)
,substr(s,j,1)
#local j=j-1;
#end
)
#end
It is essential for use with the empty string that concat still works with
only one parameter. This macro is a quick hack and probably not the
best way to reverse a string, so consider it just an example.
Mark Weyer
Post a reply to this message
|
![](/i/fill.gif) |