Re: Function initialization at the first call.

new topic     » goto parent     » topic index » view thread      » older message » newer message
SnakeCharmer said...

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.

SnakeCharmer said...

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

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu