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