<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On 19 August 2018 at 14:24, Ralph Versteegen <span dir="ltr"><<a href="mailto:teeemcee@gmail.com" target="_blank">teeemcee@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div><div>You might be wondering what the purpose of function (command, script and math function) attributes are. Well, I will use @obsolete to mark commands that you shouldn't use, since I noticed it's easy to make the mistake of calling getattackname instead of readattackname. Aside from that, I simply imagine we'll want some more in future...<br>I used the @ syntax to look like Python decorators, but that can still be changed. It turns out that using @ for both references and attributes isn't a problem, because all valid attribute names are hardcoded in hspeak.<br><br></div>One possible attribute might be @builtin for scripts in plotscr.hsd, to mark that they should be skipped over the debugger.<br></div>Or @shadow could make a script's variables shadow the names of global variables/constants, instead of using an ugly hsd: prefix on everything.<br></div>But both of those could be replaced with some whole-file directive instead. I was actually thinking of some "namespace" block, to make it easier to slot in someone's scripts without clashes. Probably a bit overboard.<br><br></div>Another one would be @optimize(always/never) which I need in order to write testcases for hspeak's math simplification. You might remember that there is a bug where ^ is misoptimised on Mac; I never checked that fix in because I couldn't write a testcase for it! I started implementing a "directive" statement, which I never finished but oddly enough duplicated part of what attributes do.<br></div></blockquote><div><br></div><div>On second thoughts there was no reason I couldn't write testcases, just another one of my bad excuses!<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On 19 August 2018 at 14:03,  <span dir="ltr"><<a href="mailto:subversion@hamsterrepublic.com" target="_blank">subversion@hamsterrepublic.<wbr>com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">teeemcee<br>
2018-08-18 19:03:53 -0700 (Sat, 18 Aug 2018)<br>
117<br>
hspeak: scripts and subscripts can now have attributes too<br>
<br>
Phew, that was a lot more complex to add than expected...<br>
---<br>
U   wip/hspeak.exw<br>
U   wip/testgame/parser_tests.hss<br>
______________________________<wbr>_________________<br>
Ohrrpgce mailing list<br>
<a href="mailto:ohrrpgce@lists.motherhamster.org" target="_blank">ohrrpgce@lists.motherhamster.o<wbr>rg</a><br>
<a href="http://lists.motherhamster.org/listinfo.cgi/ohrrpgce-motherhamster.org" rel="noreferrer" target="_blank">http://lists.motherhamster.org<wbr>/listinfo.cgi/ohrrpgce-motherh<wbr>amster.org</a><br>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div></div>