Feature - Rejected Is to_coinmaster obsolete?

Given that to_coinmaster has not been needed for the proxy methods of .buyer and .seller for some time and $coinmaster[ Dimemaster ] suffices for string usage, do we still need it?
 

Theraze

Active member
If you're using an unknown coinmaster, where it's useful is in things like this:
Code:
string storedCoinmaster;
coinmaster staticCoinmaster;
coinmaster dynamicCoinmaster;
storedCoinmaster = "Dimemaster";
staticCoinmaster = $coinmaster[storedCoinmaster];
dynamicCoinmaster = to_coinmaster(storedCoinmaster);
You'd think that they'd return the same results, but...
> ash string storedCoinmaster; coinmaster staticCoinmaster; coinmaster dynamicCoinmaster; storedCoinmaster = "Dimemaster"; staticCoinmaster = $coinmaster[storedCoinmaster];

Bad coinmaster value: "storedCoinmaster" ()
Returned: void

> ash string storedCoinmaster; coinmaster staticCoinmaster; coinmaster dynamicCoinmaster; storedCoinmaster = "Dimemaster"; dynamicCoinmaster = to_coinmaster(storedCoinmaster);

Returned: Dimemaster
token => dime
item => none
property => availableDimes
available_tokens => 0
buys => true
sells => true

Anytime you actually NEED to turn a string (from a saved map file, for example) back into a coinmaster, to_coinmaster() is your function. Anytime you're dealing with a static record, just use $coinmaster.

Basically, $coinmaster is compiled (I believe?) at runtime, while to_coinmaster is compiled on execution. That makes $coinmaster faster, but a static record unable to use a dynamic string.
 
Top