<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
</style>
</head>
<body class='hmmessage'>
> Date: Fri, 9 Jan 2009 16:11:05 -0800<br>> From: Bob@HamsterRepublic.com<br>> To: ohrrpgce@lists.motherhamster.org<br>> Subject: [Ohrrpgce] thinking out loud about magic variables in hamsterspeak<br>> <br>> So in python you can do something pretty cool where you set up get/set <br>> functions for a property name, and then you can read and write to it as <br>> if it was a variable, buty all your reads and writes go through the <br>> get/set functions<br>> <br>> Why couldn't we do something kinda like this in HamsterSpeak?<br>> <br>> Suppose we create a new class of variables. To distinguish them from <br>> global and local variables, I'm going to call them "magic variables"<br>> <br>> So maybe you create one with a command like this:<br>> <br>>  magic variable(v, get v, set v)<br>> <br>> where v is the name of the new magic variable, "get v" is a script that <br>> returns something, and "set v" is a script that takes 1 argument. See <br>> how that could be cool?<br>> <br>>  magic variable(money, party money, set money)<br>> <br>> Then you could set money by saying:<br>> <br>>  money := 100<br>> <br>> Or retieve money by saying:<br>> <br>>  show value(money)<br>> <br>> Now what would make this even cooler is if arguments could be added. <br>> Maybe something like:<br>> <br>>  magic variable(spell, 3, read spell, write spell)<br>> <br>> So you could specify 3 arguments to the "spell" magic variable, <br>> something like this:<br>> <br>>  spell(who, 0, 0) := atk:Punch<br>> <br>> or<br>> <br>>  get attack name(0, spell(who, 0, 0))<br>> <br>> The above two examples operating on the first spell in the first spell <br>> list of the hero specified in the "who" variable.<br>> <br>> Anyway, I just wanted to share that idea while I had it, in case anyone <br>> has any comments on whether or not it seems like a good idea, how how it <br>> might be done better.<br>> <br>> ---<br>> James Paige<br>> _______________________________________________<br>> Ohrrpgce mailing list<br>> ohrrpgce@lists.motherhamster.org<br>> http://lists.motherhamster.org/listinfo.cgi/ohrrpgce-motherhamster.org<br><br><br>That's an awesome idea.  That'd make it easier to set values for such variables without having to remember the function names to do so with.<br><br /><hr />Windows Live™: Keep your life in sync.  <a href='http://windowslive.com/explore?ocid=TXT_TAGLM_WL_t1_allup_explore_012009' target='_new'>Check it out.</a></body>
</html>