Re: will map:put() never fail?

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

Shouldn't map:put() be a function in case it needs to report an error? I don't see anything like "map:get_error()" either...

Or maybe map:put() will never fail?

It can fail, but if it does it causes a program fail too. It can fail for these reasons ...

  1. The MAP ID is wrong. Either an invalid value or it refers to an object which isn't a map.
  2. The OPERATION argument is not a valid value.
  3. The OPERATION argument is invalid for the case when the KEY does not exist in the map.
  4. The computer's RAM has been exhausted.


I think that the idea was that if one of these situations arose, then the application is already compromised and cannot continue anyhow.

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

Search



Quick Links

User menu

Not signed in.

Misc Menu