Wc3C.net

Wc3C.net (http://www.wc3c.net/forums.php)
-   Warcraft Editing Tools (http://www.wc3c.net/forumdisplay.php?f=13)
-   -   JassHelper 0.A.2.B - A vJass and Zinc 2 Jass compiler (http://www.wc3c.net/showthread.php?t=88142)

MindWorX 04-10-2009 09:12 PM

Quote:

Originally Posted by TriggerHappy187
Reminds me of C#.

call BJDebugMsg(u.toInt().toString())

Shh, don't say that, vex don't like us comparing vJass to C#!

Quote:

Originally Posted by Seshiro
I asked him a few months ago the same^^
But he said no... ;(

I bet you didn't ask him as nicely as i did.

TriggerHappy 04-10-2009 09:31 PM

That feature would be cool, I vote yes.

Vexorian 04-10-2009 11:49 PM

Quote:

Originally Posted by TriggerHappy187
Reminds me of C#.

call BJDebugMsg(u.toInt().toString())

That's actually Java and since C# is basically "Java done wrong', it is no surprise it reminds you of C#.

TriggerHappy 04-11-2009 01:02 AM

Quote:

Originally Posted by Vexorian
That's actually Java and since C# is basically "Java done wrong', it is no surprise it reminds you of C#.


So what do you say on the feature :emote_thumbup:

EDIT: Maybe some extending of methods?

Well, I haven't seen a way to do it yet.

Collapse JASS:
    struct int
    
        method inHalf takes nothing returns string
            return SubString(this, 0, (StringLength(this)/2))
        endmethod
        
        method toString takes nothing returns string
            return I2S(this)
        endmethod
        
    endstruct
    
    function testing takes nothing returns nothing
        local int i = 345344
        call i.toString().inHalf()
    endfunction

Seshiro 04-11-2009 02:53 PM

Hah! I've found it.....http://www.wc3c.net/showpost.php?p=1...postcount=1214
this, just without variables!

Greez

Vexorian 04-11-2009 03:38 PM

Quote:

Originally Posted by grim001
Bug report:

Collapse JASS:
globals
    constant integer Size = 24573
endglobals

struct SomeStruct [Size]

endstruct

Doesn't work when you have Size set to a variable, the value needs to be entered directly or it has no effect. This is pretty bad for systems.

I just tested that code and it works correctly, maybe you need a less reduced of an example.

akolyt0r 04-11-2009 05:42 PM

Collapse JASS:
struct evil
    method operator evilop takes nothing returns real
        return .evilop
    endmethod
endstruct
this looks evil !!!

Vexorian 04-11-2009 06:00 PM

So what? It is just your normal never-stopping self recursion.

akolyt0r 04-11-2009 06:13 PM

i think a decent compiler shouldnt not let a never-ending recursion compile obviously, such a thing doesnt make sense anyway (hitop, unless you use TSA).

couldnt you just check if there is another return in the function which doesnt return the function itself ?

But well if you like it, ....
I like it aswell, it looks like fun ;)

Earth-Fury 04-11-2009 06:59 PM

Quote:

Originally Posted by akolyt0r
i think a decent compiler shouldnt not let a never-ending recursion compile obviously, such a thing doesnt make sense anyway (hitop, unless you use TSA).

couldnt you just check if there is another return in the function which doesnt return the function itself ?

But well if you like it, ....
I like it aswell, it looks like fun ;)


JASS Helper isn't really a validating compiler. It does a best-effort to compile, then dies if it can't. Thus why PJASS is called after compilation.

Also, "shouldnt not" is just plain wrong. In more than one way.

akolyt0r 04-11-2009 07:03 PM

well ... that happens when you edit posts, and dont double check it afterwards ;(

Then let the inifinite recursion exist ...its fun

Vexorian 04-11-2009 07:12 PM

Quote:

Originally Posted by akolyt0r
i think a decent compiler shouldnt not let a never-ending recursion compile obviously, such a thing doesnt make sense anyway (hitop, unless you use TSA).

couldnt you just check if there is another return in the function which doesnt return the function itself ?

But well if you like it, ....
I like it aswell, it looks like fun ;)

Jass doesn't avoid it either:

Collapse JASS:
function err takes nothing returns nothing
    return err()
endfunction
I don't get why must it prevent it, should it also stop infinite loops then? The halting problem is still yet to be solved, I'll let the users to make that sort of mistake instead of implementing something like that, adding a check for this specific case is possible but then people will start asking me to add checks for other similar issues and that's something that does not interest me that much.

Ammorth 04-11-2009 09:49 PM

Quote:

Originally Posted by akolyt0r
i think a decent compiler shouldnt not let a never-ending recursion compile obviously, such a thing doesnt make sense anyway (hitop, unless you use TSA).


fixed:
I think a decent coder should never write code that enters never-ending loops. Such a thing doesn't make sense anyways.

akolyt0r 04-11-2009 11:23 PM

...
have you thought of parsing blizzard.j and automatically inlining BJs ? (well...the one-line ones)...
I dont need it, and i am not sure if its good anyway, ...but it might save some work for people who convert old gui stuff to jass...

Vexorian 04-11-2009 11:39 PM

The optimizer already does it, so not really, though I guess that once it parses blizzard.j inlining bjs would be a side effect.


All times are GMT. The time now is 08:28 AM.

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