wc3campaigns
WC3C Homepage - www.wc3c.netUser Control Panel (Requires Log-In)Engage in discussions with other users and join contests in the WC3C forums!Read one of our many tutorials, ranging in difficulty from beginner to advanced!Show off your artistic talents in the WC3C Gallery!Download quality models, textures, spells (vJASS/JASS), systems, and scripts!Download maps that have passed through our rigorous approval process!

Go Back   Wc3C.net > Warcraft III Modding > Developer's Corner > Triggers & Scripts
User Name
Password
Register Rules Get Hosted! Chat Pastebin FAQ and Rules Members List Calendar



View Poll Results: what keyword?
thistype 13 56.52%
thisstruct 3 13.04%
me 6 26.09%
structname 1 4.35%
STRUCT_NAME 0 0%
Voters: 23. You may not vote on this poll

Reply
 
Thread Tools Search this Thread
Old 04-03-2009, 08:24 PM   #1
Vexorian
Free Software Terrorist
 
Vexorian's Avatar


Technical Director
 
Join Date: Apr 2003
Posts: 14,898

Submissions (37)

Vexorian has a reputation beyond repute (1062)Vexorian has a reputation beyond repute (1062)Vexorian has a reputation beyond repute (1062)Vexorian has a reputation beyond repute (1062)Vexorian has a reputation beyond repute (1062)Vexorian has a reputation beyond repute (1062)Vexorian has a reputation beyond repute (1062)

Hero Contest #3 - 2nd Place

Default keyword for "this struct"

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

Collapse 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:


Collapse 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.
__________________
Zoom (requires log in)Wc3 map optimizer 5.0
Someone should fix .wav sound in this thing.
Zoom (requires log in)JassHelper 0.A.2.A
Turns your simple code into something that is complicated enough to work.
Faster != more useful
Vexorian is offline   Reply With Quote
Sponsored Links - Login to hide this ad!
Old 04-03-2009, 08:49 PM   #2
PurplePoot
User


Official Map Reviewer
 
Join Date: Jan 2006
Posts: 363

PurplePoot will become famous soon enough (60)PurplePoot will become famous soon enough (60)PurplePoot will become famous soon enough (60)

Default

You could always just use this? More keywords tends to get annoying after a point.
PurplePoot is offline   Reply With Quote
Old 04-03-2009, 08:52 PM   #3
Vexorian
Free Software Terrorist
 
Vexorian's Avatar


Technical Director
 
Join Date: Apr 2003
Posts: 14,898

Submissions (37)

Vexorian has a reputation beyond repute (1062)Vexorian has a reputation beyond repute (1062)Vexorian has a reputation beyond repute (1062)Vexorian has a reputation beyond repute (1062)Vexorian has a reputation beyond repute (1062)Vexorian has a reputation beyond repute (1062)Vexorian has a reputation beyond repute (1062)

Hero Contest #3 - 2nd Place

Default

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...
__________________
Zoom (requires log in)Wc3 map optimizer 5.0
Someone should fix .wav sound in this thing.
Zoom (requires log in)JassHelper 0.A.2.A
Turns your simple code into something that is complicated enough to work.
Faster != more useful
Vexorian is offline   Reply With Quote
Old 04-03-2009, 09:06 PM   #4
PurplePoot
User


Official Map Reviewer
 
Join Date: Jan 2006
Posts: 363

PurplePoot will become famous soon enough (60)PurplePoot will become famous soon enough (60)PurplePoot will become famous soon enough (60)

Default

self? I'm drawing blanks otherwise.

Last edited by PurplePoot : 04-03-2009 at 09:06 PM.
PurplePoot is offline   Reply With Quote
Old 04-03-2009, 09:17 PM   #5
moyack
Evil Emoticon
 
moyack's Avatar


Respected User
Project Leader: PoC
 
Join Date: Jan 2006
Posts: 3,279

Submissions (17)

moyack is a splendid one to behold (666)moyack is a splendid one to behold (666)moyack is a splendid one to behold (666)moyack is a splendid one to behold (666)

AI Tournament #2 - 2nd PlaceHero Contest - Second place

Send a message via MSN to moyack
Default

waht about me??

Collapse 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
moyack is offline   Reply With Quote
Old 04-03-2009, 09:35 PM   #6
peq
User
 
peq's Avatar
 
Join Date: Jul 2006
Posts: 57

peq has little to show at this moment (4)

Default

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".
peq is offline   Reply With Quote
Old 04-03-2009, 09:36 PM   #7
TEC_Ghost
User
 
TEC_Ghost's Avatar
 
Join Date: Jul 2002
Posts: 416

TEC_Ghost will become famous soon enough (65)TEC_Ghost will become famous soon enough (65)TEC_Ghost will become famous soon enough (65)

Default

I vote use "that"
__________________

Projects
TEC_Ghost is offline   Reply With Quote
Old 04-03-2009, 09:57 PM   #8
akolyt0r
In Flames
 
akolyt0r's Avatar
 
Join Date: Jan 2006
Posts: 1,154

Submissions (3)

akolyt0r has a spectacular aura about (120)

Default

yeah ..i think this feature is totally unneeded ...
some simple search/replace achieves the same..
__________________
akolyt0r is offline   Reply With Quote
Old 04-03-2009, 10:09 PM   #9
Vexorian
Free Software Terrorist
 
Vexorian's Avatar


Technical Director
 
Join Date: Apr 2003
Posts: 14,898

Submissions (37)

Vexorian has a reputation beyond repute (1062)Vexorian has a reputation beyond repute (1062)Vexorian has a reputation beyond repute (1062)Vexorian has a reputation beyond repute (1062)Vexorian has a reputation beyond repute (1062)Vexorian has a reputation beyond repute (1062)Vexorian has a reputation beyond repute (1062)

Hero Contest #3 - 2nd Place

Default

Quote:
I think this is only useful if you want to rename the struct
Nah, it is useful for something else.
__________________
Zoom (requires log in)Wc3 map optimizer 5.0
Someone should fix .wav sound in this thing.
Zoom (requires log in)JassHelper 0.A.2.A
Turns your simple code into something that is complicated enough to work.
Faster != more useful
Vexorian is offline   Reply With Quote
Old 04-03-2009, 10:10 PM   #10
moyack
Evil Emoticon
 
moyack's Avatar


Respected User
Project Leader: PoC
 
Join Date: Jan 2006
Posts: 3,279

Submissions (17)

moyack is a splendid one to behold (666)moyack is a splendid one to behold (666)moyack is a splendid one to behold (666)moyack is a splendid one to behold (666)

AI Tournament #2 - 2nd PlaceHero Contest - Second place

Send a message via MSN to moyack
Default

it makes the code more readable and faster to write, and this is always valuable.

Last edited by moyack : 04-03-2009 at 10:12 PM.
moyack is offline   Reply With Quote
Old 04-03-2009, 10:15 PM   #11
grim001
requires vJass
 
grim001's Avatar


Code Moderator
 
Join Date: Nov 2006
Posts: 1,540

Submissions (10)

grim001 is just really nice (277)grim001 is just really nice (277)

Send a message via AIM to grim001
Default

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:

Collapse 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.

Last edited by grim001 : 04-03-2009 at 10:21 PM.
grim001 is offline   Reply With Quote
Old 04-03-2009, 10:20 PM   #12
Vexorian
Free Software Terrorist
 
Vexorian's Avatar


Technical Director
 
Join Date: Apr 2003
Posts: 14,898

Submissions (37)

Vexorian has a reputation beyond repute (1062)Vexorian has a reputation beyond repute (1062)Vexorian has a reputation beyond repute (1062)Vexorian has a reputation beyond repute (1062)Vexorian has a reputation beyond repute (1062)Vexorian has a reputation beyond repute (1062)Vexorian has a reputation beyond repute (1062)

Hero Contest #3 - 2nd Place

Default

textmacros (well, something like that) are the main reason behind this
__________________
Zoom (requires log in)Wc3 map optimizer 5.0
Someone should fix .wav sound in this thing.
Zoom (requires log in)JassHelper 0.A.2.A
Turns your simple code into something that is complicated enough to work.
Faster != more useful
Vexorian is offline   Reply With Quote
Old 04-03-2009, 10:21 PM   #13
grim001
requires vJass
 
grim001's Avatar


Code Moderator
 
Join Date: Nov 2006
Posts: 1,540

Submissions (10)

grim001 is just really nice (277)grim001 is just really nice (277)

Send a message via AIM to grim001
Default

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

Last edited by grim001 : 04-03-2009 at 11:59 PM.
grim001 is offline   Reply With Quote
Old 04-06-2009, 04:04 AM   #14
Vexorian
Free Software Terrorist
 
Vexorian's Avatar


Technical Director
 
Join Date: Apr 2003
Posts: 14,898

Submissions (37)

Vexorian has a reputation beyond repute (1062)Vexorian has a reputation beyond repute (1062)Vexorian has a reputation beyond repute (1062)Vexorian has a reputation beyond repute (1062)Vexorian has a reputation beyond repute (1062)Vexorian has a reputation beyond repute (1062)Vexorian has a reputation beyond repute (1062)

Hero Contest #3 - 2nd Place

Default

Yes, that's right I turned it into a poll
__________________
Zoom (requires log in)Wc3 map optimizer 5.0
Someone should fix .wav sound in this thing.
Zoom (requires log in)JassHelper 0.A.2.A
Turns your simple code into something that is complicated enough to work.
Faster != more useful
Vexorian is offline   Reply With Quote
Old 04-06-2009, 07:03 AM   #15
Viikuna-
User
 
Viikuna-'s Avatar
 
Join Date: Feb 2009
Posts: 203

Viikuna- will become famous soon enough (44)Viikuna- will become famous soon enough (44)

Default

I missvoted "me", but I really think that "thistype" is the best.
__________________
No Marlo, no game.
Viikuna- is offline   Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off


All times are GMT. The time now is 06:48 PM.


Affiliates
The Hubb The JASS Vault Clan WEnW Campaign Creations Clan CBS GamesModding Flixreel Videos

Powered by vBulletin (Copyright ©2000 - 2019, Jelsoft Enterprises Ltd).
Hosted by www.OICcam.com
IT Support and Services provided by Executive IT Services