Re: Function initialization at the first call.
- Posted by mattlewis (admin) Jan 18, 2013
- 1159 views
Thanks. I am glad that the principle was good. For some reason I was afraid that it is inadmissible ideologically.
The only other way would be to have a separate variable as a flag to identify whether you have initialized it. The 4.0 update to object()'s behavior was intended to simplify this.
UPD: By the way, it would be much more convenient to make String equal to "" initially. What is the best way to check emptiness of string?
Possibly, but this could also lead to other program errors. Basically, it would be more difficult to catch places where you forgot to initialize something correctly, since we couldn't produce an error. In any case, there is no "default" variable value for any sort of euphoria objects, and I don't see that happening.
Matt