Duplicate Functions
Displaying 1-18 of 18 total.
1
Please enter a numerical value for the importance of this sticky.
Enter 0 to unsticky.
Overkill

If duplicate function names are declared, the newest instance of function duplicate is used, instead of erroring.


int bar;
void Foo()
{

}

void Foo(int a, int b)
{
bar = a + b;
}


Is this intentional?

Posted on 2005-07-13 10:32:53

Jesse

This looks intentional to me; there is code to check against duplicate functions in the standard library (ie you can't override any verge-standard function) but nothing for user functions. I'm assuming this is so that maps can override system-level functions.

If that is the case, we could still allow that special case while preventing it from happening within a map or within system.vc. Or maybe it's just an oversight. Thoughts?

Posted on 2005-07-13 12:17:54

Gayo

I definitely like maps being able to override globals. But if you keep that I don't care if you put in other dupe checking.

Posted on 2005-07-15 12:40:16

Toen

Problem with the new build: I just tracked down an accidental double function call in the same map vc file and I experienced some extremely fucked up results that the old compiler at least handled.

<zumpiez[duskbane]> it's a zone that's misbehaving.
<zumpiez[duskbane]> if I step on it, the map reloads kinda.
<gannon> eep
<gannon> kinda?
<zumpiez[duskbane]> ...it doesn't reload very cleanly though
<zumpiez[duskbane]> well
<zumpiez[duskbane]> my old player entities are still there, and now I'm controlling new ones
<gannon> wow weird
<zumpiez[duskbane]> yeah.


This particular result is probably going to be hard to reproduce. Suffice to say though that it gets real fucky instead of informing you or handling it.

Posted on 2005-07-22 04:37:21

gannon

just a note that system functions over ride map ones in the builds of verge I have.

Posted on 2005-07-22 04:44:41

Jesse

Duplicate functions are no longer allowed within the system.vc or map.vc. They can still have duplicates between them, in which the system overrides the map's.

Posted on 2005-07-24 22:56:59

gannon

well there wasn't any duplicates in system.vc

Posted on 2005-07-24 23:06:16

gannon

um does this mean you can't have the same function in different map.vc? because this would fundilmentaly break alot of code

Posted on 2005-07-25 02:34:39

Jesse

Before this, you could have duplicates in system.vc. Now you can't.

Multiple maps can also have the same functions. The only thing this change prevents is one map's vc or system.vc from having a function more than once.

Posted on 2005-07-25 08:08:16

Gayo

I'd kinda prefer it map funcs overrode sys.vc funcs just as a case of using the most specific version available, but eh. Good show.

Posted on 2005-07-25 21:27:05

Jesse

I agree with ya, Gayo, I'm just worried it might break something to flip the direction. Maybe that's just paranoid; it would be easy to do, I think.

Posted on 2005-07-25 21:45:21

Jesse

EDIT: Actually, if I thought before I typed, that would be good.

In the current verge, map functions DO override system ones. Please confirm!

Posted on 2005-07-25 21:52:44

gannon

nope in the current verge system functions override map functions. At least in my test.

Posted on 2005-07-26 10:53:28

gannon

ok did some more testing it is a bit more complex :P
the loctation of the calling function is where what overrides it. ie if you call a function in a map it checks that map fuctions first but if you call it in a system.vc then it uses the function in system.vc. For the map starting functions it uses the system.vc (oddly)
I would like to see this made consistant. ie all map.vc allways overrides.

Posted on 2005-07-26 11:04:24

gannon

ok more testing callFunction checks the system.vc first even if it is called withing a map

Posted on 2005-07-26 11:06:27

gannon

um that really needs to be fixed that would break it if they wanted to make a recursive function using callFunction in a map.vc
I know its not something you would want to do but still someone might want to do it.

Posted on 2005-07-26 11:14:08

Overkill

Yay, quadruple posting. I guess it can't be helped though when someone won't fix the edit page's code already ;D.

Posted on 2005-07-26 18:11:21

mcgrue

Overkill, have I told you lately precisely how much I hate you?

It's this much.

That's a lot, you see.

Posted on 2005-07-27 07:11:49


Displaying 1-18 of 18 total.
1
 
Newest messages

Ben McGraw's lovingly crafted this website from scratch for years.
It's a lot prettier this go around because of Jon Wofford.
Verge-rpg.com is a member of the lunarnet irc network, and would like to take this opportunity to remind you that regardless how babies taste, it is wrong to eat them.