Static ifs no longer work ^_^

Nestharus

o-o
Reaction score
84
hooray!! static ifs are dead : D

JASS:

library aafafdsfs
globals
        private constant boolean REMOVE_UNITS_INI = true //remove all units owned by players not in map at ini
        private constant boolean REMOVE_UNITS_LEAVE = true //remove all units owned by player
                                                            //when that player leaves, done after event fire
                                                            
        private constant boolean HUMAN = true //track human players
        private constant boolean COMPUTER = true //track computer players
        private constant boolean ACTIVE = true //track active players
        private constant boolean INACTIVE = true //track inactive players
        
        private constant boolean HUMAN_OUT_EVENT = true //fire events when a human leaves/removed
        private constant boolean COMPUTER_OUT_EVENT = true //fire events when a computer is removed
        
        private constant integer HIDDEN_PLAYER_ID = 14 //for use with GetHiddenPlayer, player 14
                                                       //is suggested as it has bounty etc enabled
endglobals

function test takes nothing returns nothing
    static if REMOVE_UNITS_INI then
        local integer s
        a
    else
        DISPLAY ERROR //displays
    endif
endfunction
endlibrary


JASS:

library aafafdsfs
globals
        constant boolean REMOVE_UNITS_INI = true //remove all units owned by players not in map at ini
        constant boolean REMOVE_UNITS_LEAVE = true //remove all units owned by player
                                                            //when that player leaves, done after event fire
                                                            
        constant boolean HUMAN = true //track human players
        constant boolean COMPUTER = true //track computer players
        constant boolean ACTIVE = true //track active players
        constant boolean INACTIVE = true //track inactive players
        
        constant boolean HUMAN_OUT_EVENT = true //fire events when a human leaves/removed
        constant boolean COMPUTER_OUT_EVENT = true //fire events when a computer is removed
        
        constant integer HIDDEN_PLAYER_ID = 14 //for use with GetHiddenPlayer, player 14
                                                       //is suggested as it has bounty etc enabled
endglobals

function test takes nothing returns nothing
    static if REMOVE_UNITS_INI then
        local integer s
        a
    else
        DISPLAY ERROR //displays
    endif
endfunction
endlibrary


....

I guess I'm done writing until fixed... :\... all resources with static ifs in them are summarily destroyed.


so cJASS is broken as it's riddled with bugs, vjass is now broken as it too has too many bugs to even work with, and I don't even want to mess with Zinc because that has massive bug fixes every update ;o.

Hooray, back to vanilla JASS I go.
 

Narks

Vastly intelligent whale-like being from the stars
Reaction score
90
wtf is this thread

JASS:
    static if REMOVE_UNITS_INI then
        local integer s
        a
    else
        DISPLAY ERROR //displays
    endif

wtf is that

no srsly, what the hell are you talking about
 

Xorifelse

I'd love to elaborate about discussions...........
Reaction score
87
wtf is this thread

JASS:
    static if REMOVE_UNITS_INI then
        local integer s
        a
    else
        DISPLAY ERROR //displays
    endif

wtf is that

no srsly, what the hell are you talking about

Static ifs, it's like Jass pre pre pre pre pre compiler, you could compare it with c++'s pre processor.

Code:
#define meh
#ifdef meh
  const int meh = 1;
#else
  const int meh = 2;
#endif

In other words, code that is in there does not have to be in the script itself when it's compiled.
 

Lyerae

I keep popping up on this site from time to time.
Reaction score
105
We really need to make a new language which ISN'T completely bugged.
And making a developement team to work on it instead of one person would really help.
 

Nestharus

o-o
Reaction score
84
http://www.wc3c.net/showpost.php?p=1120197&postcount=1775

oh yea, and I happen to be doing a c# tool ; ).

I'd do it in C (cuz I'm cool like that), but... it's for a project. Hitting two birds with one stone : D.

Yea, I was doing lots of vjass, then I ran into bugs and limits on it because vexorian refuses to address some issues, so I went to cjass, which is riddled with massive amounts of bugs and the language is pretty much still 100% under dev, so I went back to vjass and this static if issue was the last straw : D, lol.

I say, screw all of your languages, I'm using 100% interpreted to write my code now -.-... no more static code or craptastic deprecated preprocessor directives. All preprocessing directives should be just an interpreted language >: O. It'd let me get out of my limitations, let people expand the language very easily, and it would Solve All Of These Damned bugs.. >: (

So, Euphoria is my personal choice for a good preprocessing language, but Grimoire is easier to use and runs on Lua.

So which language will I write this for? Not sure yet, but it's between those 2 : o. And if you ask for javascript or python or something like that, I shoot u >: p. Reasons I might not choose euphoria is because it's not that well supported. Installing it is a bitch, finding resources for it that aren't 10 years old is a bitch, and well, yea ;o. Lua has lots of distributions, pretty fast, easy to use, and the tools are still maintained ;o. It's also incredibly easy to install.

Here, you guys can play with it, sec-
http://luaforwindows.luaforge.net/
http://www.lua.org/pil/index.html

and for MPQ Manipulation
http://www.zezula.net/en/mpq/stormlib.html


So.. if we just change all of jasshelper around to run on this stuff and auto extract crap out of the map, that'd be golden : ).

Whatever language chosen, I'm doing a lexical object for writing the code and automatic analysis of code that's static. Lua code will have access to where they are in the code (they can be run like smart macros) and will also have access to the entire code environment.

Take that vjass, cjass, zinc, and all the others that people might have been planning. This beats you all >: O. With this, I shall make the language whatever I want it to be, and anyone else would have that same power >: O. It also won't be in some crazy obscure college only language like what vjass is written in or some crazy low level language that's impossible to read or debug like cjass is written in >: O. The core will be in c# for ease of use (who cares about preprocessing speed...) and Lua for actual writing of scripts : |.

Come and let us lead a revolution and Revolt!! >: O
/declares war on vjass, zinc, and cjass

burn them all!!
 

Kenny

Back for now.
Reaction score
202
I don't think you'll solve it.

Maybe someone else should... ;)

Vex doesn't seem to be very active lately, it would be cool for someone to take over and add the functionality that's needed, while fixing some of the inherent problems with vJASS.
 

Nestharus

o-o
Reaction score
84
>while fixing some of the inherent problems with vJASS.

To vexorian and a lot of wc3c, those problems aren't problems... and the fixes are problems... ><

so they're never going to get fixed...

and j4l, I totally agree with you on inheritance... it's insane... I mean, if you did have multi inheritance (inherit from multiple parents), you'd need to do it like it's currently done in vjass for every one but the root one, but ... single inheritance???

><...

for those of you who don't know what we are talking about, you don't need to know because you would have nightmares ; ).
 

Azlier

Old World Ghost
Reaction score
461
Stop pointing out things that don't work and find something that actually does.

And more importantly, static ifs are fine.

This causes no syntax errors and ends the game, using latest Jasshelper:
JASS:
static if true then
    call EndGame(true)
else
    tis
endif


I'm tempted to blame AdicHelper. Or maybe your lack of an [ljass]initializer[/ljass] keyword but knowing you you're probably calling it somewhere else like a madman would. Either way, it's your fault.
 

Nestharus

o-o
Reaction score
84
>I'm tempted to blame AdicHelper. Or maybe your lack of an initializer keyword but knowing you you're probably calling it somewhere else like a madman would. Either way, it's your fault.

adichelper was 100% disabled... and why would I need to call that function when I had syntax errors on there purposefully to see what it would do with the static if... : |

It put the //# on the wrong lines every time ^_^.

You can go ahead and cnp my demo code to see for yourself.

>Stop pointing out things that don't work and find something that actually does.
I write with static ifs and lots of resources use static ifs.. knowing that they only work some of the time isn't good.... they're as fritzy as #ifs in cjass ><.

Oh and
>I don't think you'll solve it.

Instantly solved by using an interpreted language that's already been made >: ), lol.
 

Jesus4Lyf

Good Idea™
Reaction score
397
And more importantly, static ifs are fine.
He's actually right, it's a problem; there is a bug with comments and static ifs. He just needs a saner way to comment his code, for now (ie. line above sort of thing).
JASS:
library aafafdsfs initializer test
globals
        private constant boolean LETS_SEE_IF_COMMENTS_BREAK_STATIC_IFS = true //
endglobals                                                         //         ^ Remove for great joy.

function test takes nothing returns nothing
    static if LETS_SEE_IF_COMMENTS_BREAK_STATIC_IFS then
        call BJDebugMsg(&quot;Works&quot;)
    else
        call BJDebugMsg(&quot;Broken.&quot;)
    endif
endfunction
endlibrary

There are much bigger problems with inheritance not compiling correctly. That's why I carefully encapsulate things like SpellStruct, so I tuck away my work-arounds...
Instantly solved by using an interpreted language that's already been made
Well, let me know when you got it working...
 

Lyerae

I keep popping up on this site from time to time.
Reaction score
105
> it would be cool for someone to take over.

I've actually been wanting to create my own language for some time now.
Mainly as a "holy crap I'm bored project", but if enough people are interested, I could finish my first-draft of the definition, get some CnC, and then work on the preprocessor.

Of course, it would be fully compatble with JassHelper and AdicHelper (I will beg them for keywords which will make them not parse the new language), and hopefully cross-platform (written in C.).
 

Nestharus

o-o
Reaction score
84
>There are much bigger problems with inheritance not compiling correctly. That's why I carefully encapsulate things like SpellStruct, so I tuck away my work-arounds...

I know man ... I know all the work arounds too : \... I mean, that is standard protocol (how it's done in vjass) with regular languages... but vjass works off of arrays, so what vexorian does is bleh..

There are other things too... just so much wrong with inheritance, lol... you pretty much have to make method wrappers for the base struct if you want to have nice looking syntax : |...

One good thing about vjass would have to be keys though when you are dealing with extremely polymorphic type actions... but anyways... I guess I'll write the interpreted language tool and make it easily usable for all archives/projects, but it'll be awhile. I have to write it anyways for a class, so I was going to do it, lol.
 

Trollvottel

never aging title
Reaction score
262
mh, how come everything is broken? and how come we realise it today and not weeks before?
 

Nestharus

o-o
Reaction score
84
mh, how come everything is broken? and how come we realise it today and not weeks before?

It's all been broken forever, just nobody would mention it because everyone expected it to be fixed, and now that it's been broken for so long, people are no longer expecting it to ever be fixed, so it's now being mentioned =D.

Although I didn't know about the static if... woulda figured that out eventually, but that's such a screwy bug ><.

Then again, only the people who really delved into vjass knew about the inheritance issues ; ). I always check out the code that vjass puts out, and I know jesus4lyf does too, so that's how we found out ; D. I had nightmares that night ;o.
 

Jesus4Lyf

Good Idea™
Reaction score
397
Then again, only the people who really delved into vjass knew about the inheritance issues ; ). I always check out the code that vjass puts out, and I know jesus4lyf does too, so that's how we found out ; D. I had nightmares that night ;o.
Actually, I'm not just talking about the nested trigger evaluates, which I got over. I'm talking about the fact that a lot of it doesn't compile successfully, and that you can't inherit from multiple interfaces (or a struct-type and an interface).

Seriously, a lot of vJass features don't even compile correctly. Overriding the .destroy method on a subclass will not have the said .destroy method called when you destroy it as a higher class, for example (so what's the point of having inheritance if polymorphism doesn't work?). Another example is delegates don't seem compatible with inheritance, and private module members (another "inheritance" style feature) with the same name as another struct's member will stop you from accessing that struct's member. There's just lots of broken stuff. Sometimes if you have two levels of inheritance, and override destroy somewhere, you just can't seem to destroy it at a certain level...

I like vJass.
 

Nestharus

o-o
Reaction score
84
>Actually, I'm not just talking about the nested trigger evaluates

nor was I : )... you forgot to mention the incredulous array syncing for single inheritance ; D.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top