|Anonymous | Login | Signup for a new account||2013-05-23 05:37 PDT|
|Main | My View | View Issues | Change Log | Roadmap | Docs|
|Viewing Issue Simple Details|
|ID||Category||Severity||Reproducibility||Date Submitted||Last Update|
|0000011||[Robot Battle] rsl||feature||N/A||2002-03-18 22:34||2002-12-03 10:30|
|Summary||0000011: Add #include (or similar)|
|Description||Nothing more fancy that a simple text inclusion would be needed. This feature would make it possible to have simple libraries of RSL code.|
|Tags||No tags attached.|
edited on: 2002-03-18 23:41
This feature may have limited use without the ability to create locally scoped variables. Name conflicts would be common and difficult to debug.
edited on: 03-18-02 23:41
edited on: 2002-04-14 15:55
I don't think name conflicts would be much of a problem. Libraries could simply use something before there names. For example Angle becomes xzxAngle.
Also a few simple libaries could be included to deal with simple stuff like the commands Jeep wanted here: http://dev.robotbattle.com/mantis/view_bug_page.php?f_id=0000062 [^]
edited on: 04-14-02 15:55
|Also the problem with re-entering bots only for having a fresh 'secret key' could be deal with #include author.dat|
It's possible to have local variables with the current system of variable properties. I use them in a robot of mine. It works like this:
Within my section, I first do gosub(save_local) and just before I return, I do gosub(restore_local). And within the section, all local variables are properties of the variable named "local". So local.x, local.y, local.angle, or whatever.
This effectively creates a stack, or another way to think of it is as a linked list, with the ".old" property being a pointer to the tail of the list.
This has the advantage that you don't pollute your global namespace with garbage, which is good in another way: when viewing your robot in the inspector, you don't have thousands and thousands of variables to wade through. Furthermore, if you hit an assert in the middle of code, you can see all local variables in all contexts, i.e. you can see the local variables of the calling routines as well, by expanding the local.old property variables. (you could even call it something cryptic to prevent people from accidentally clobbering the stack with a local variable named 'old'.)
So, to summarize, I think an #include feature alone could allow properly written libraries to be used effectively, without polluting the global namespace or introducing variable conflicts. Now whether that will actually happen is another matter...
True local variables, real function calls with parameters and return values, and #include are a few of the top items for the next version.
Assuming user feedback doesn't change my opinion.
|Mantis 1.1.6[^] Copyright © 2000 - 2008 Mantis Group|