|
![](/i/fill.gif) |
On Wed, 22 May 2002 07:59:33 -0500, Felix Wiemann wrote:
> Where's the problem with concat? It works fine. Aren't POVers (and
> computer users in general) known for using a function for something
> totally different than it was designed for? And I don't see any
> possibility that's as short as concat.
It's common so it must be good?
I already explained the problem with using concat(). It is intended for
concatenating strings, not cloning them. To anyone reading the code, it
looks like you made a mistake: the code does not do what it says it does.
That is a bad thing.
>> If you don't want to declare a temporary variable, a macro is a better
> ^^^^^^
> Why?
If you really can't tell...I give up.
>> solution than misusing the concat() function. Something like:
>>
>> #macro clonestring(String)
>> #local tmpString = String
>> tmpString
>> #end
>
> Is much longer. So not better but worse.
I hope I never have to maintain anything you write...
It is longer by 5 characters, because its name says what it does. That is
a good thing. If the extra 5 characters is that bad, rename it: call it
clnstr() or something. And if you are using it multiple times, it would be
better to skip the macro completely and just use a temporary variable...in
that case, it is shorter than your misuse of the concat() function: the
usual naming convention just adds "tmp" or something similar, which is 5
characters shorter than a call to concat().
--
Christopher James Huff <chr### [at] mac com>
POV-Ray TAG e-mail: <chr### [at] tag povray org>
WWW: http://homepage.mac.com/chrishuff/
Post a reply to this message
|
![](/i/fill.gif) |