| 04-03-2009, 08:24 PM | #1 |
Err I need this for... err, well it would be nice to have, but I need to think of a good keyword for it. Let's say the keyword was bubba JASS:struct xxxx method orz takes nothing returns bubba endmethod method aaa takes bubba A, bubba B, bubba C returns nothing endmethod static bubba array meh endstruct Equivalent to: JASS:struct xxxx method orz takes nothing returns bubba endmethod method aaa takes xxxx A, xxxx B, xxxx C returns nothing endmethod static xxxx array meh endstruct Guess the idea is understood. |
| 04-03-2009, 08:49 PM | #2 |
You could always just use this? More keywords tends to get annoying after a point. |
| 04-03-2009, 08:52 PM | #3 |
The this keyword is already in use by jasshelper, giving two absurdly different actions to the same keyword is probably worse than having more keywords... |
| 04-03-2009, 09:06 PM | #4 |
self? I'm drawing blanks otherwise. |
| 04-03-2009, 09:17 PM | #5 |
waht about me?? JASS:struct xxxx method orz takes nothing returns me endmethod method aaa takes me A, me B, me C returns nothing endmethod static me array meh endstruct |
| 04-03-2009, 09:35 PM | #6 |
I think this is only useful if you want to rename the struct which I think is a job for texteditors and not for tools like jasshelper. But if you want it use something like "thistype" or "mytype". |
| 04-03-2009, 09:36 PM | #7 |
I vote use "that" |
| 04-03-2009, 09:57 PM | #8 |
yeah ..i think this feature is totally unneeded ... some simple search/replace achieves the same.. |
| 04-03-2009, 10:09 PM | #9 | |
Quote:
|
| 04-03-2009, 10:10 PM | #10 |
it makes the code more readable and faster to write, and this is always valuable. |
| 04-03-2009, 10:15 PM | #11 |
The keyword should be thistype. Right now I have to use textmacro constructors in many of my systems, since that's the only way to insert "this struct" and make sure it is treated as the child type (with appropriate default values set) during the constructor. I am assuming this is going to work with constructors, for example: JASS:interface Test real x = 0. real y = 0. endinterface struct Parent extends Test static method create takes unit u returns thistype local thistype p = thistype.allocate() call SetUnitX(u, p.x) call SetUnitY(u, p.y) return p endmethod endstruct struct Child extends Parent real x = 100. real y = 200. endstruct function SomeFunc takes unit u returns nothing call Child.create(u) endmethod Without thistype or a textmacro copy of the constructor for the child struct, the unit would be moved to 0, 0 instead of 100, 200. This is a major problem for certain types of systems, so this is useful for way more than search and replace. |
| 04-03-2009, 10:20 PM | #12 |
textmacros (well, something like that) are the main reason behind this |
| 04-03-2009, 10:21 PM | #13 |
OK, but will it work with constructors as per the example? Clarification: No, there will be a different way to solve the above problem, and this is intended for something else |
| 04-06-2009, 04:04 AM | #14 |
Yes, that's right I turned it into a poll |
| 04-06-2009, 07:03 AM | #15 |
I missvoted "me", but I really think that "thistype" is the best. |
