Raised This Month: $51 Target: $400
 12% 

New API and Syntax


Post New Thread Reply   
 
Thread Tools Display Modes
BAILOPAN
Join Date: Jan 2004
Old 07-27-2014 , 15:08   Re: New API and Syntax
Reply With Quote #51

Quote:
Originally Posted by MomemtumMori View Post
Will there be some form of inheritance and polymorphism at some point?
The methodmap/class syntax already supports implementation inheritance, so some kind of polymorphism comes out of that. I think it'll get more powerful over time though.
__________________
egg
BAILOPAN is offline
Dr. Greg House
Professional Troll,
Part-Time Asshole
Join Date: Jun 2010
Old 07-27-2014 , 23:50   Re: New API and Syntax
Reply With Quote #52

There really needs to be something better than the struct-hack.
__________________
Santa or Satan?

Watch out when you're paying people for private requests! Most stuff already exists and you can hardly assess the quality of what you'll get, and if it's worth the money.
Dr. Greg House is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 07-28-2014 , 00:19   Re: New API and Syntax
Reply With Quote #53

Quote:
Originally Posted by Dr. Greg House View Post
There really needs to be something better than the struct-hack.
Assuming you mean C structs, the methodmap syntax are more than just structs as C structs don't have methods.
__________________
Not currently working on SourceMod plugin development.
Powerlord is offline
KissLick
Veteran Member
Join Date: Nov 2012
Location: void
Old 07-28-2014 , 08:43   Re: New API and Syntax
Reply With Quote #54

Quote:
Originally Posted by Powerlord View Post
Assuming you mean C structs, the methodmap syntax are more than just structs as C structs don't have methods.
I guess he meant that enum ~ struct hack :-D
KissLick is offline
Dr. Greg House
Professional Troll,
Part-Time Asshole
Join Date: Jun 2010
Old 07-28-2014 , 08:56   Re: New API and Syntax
Reply With Quote #55

Quote:
Originally Posted by Powerlord View Post
Assuming you mean C structs, the methodmap syntax are more than just structs as C structs don't have methods.
They are neither.
They're just methods bound to a type.
__________________
Santa or Satan?

Watch out when you're paying people for private requests! Most stuff already exists and you can hardly assess the quality of what you'll get, and if it's worth the money.
Dr. Greg House is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 07-28-2014 , 10:05   Re: New API and Syntax
Reply With Quote #56

Quote:
Originally Posted by Dr. Greg House View Post
They are neither.
They're just methods bound to a type.
They act similarly to classes, but aren't. That's rather the point of having this transitional API. It's meant to be mainly compatible with existing SM code while introducing a new syntax.

You can choose to not do that and create an actual Class. The only apparent downside is that it can't be used with functions that have an any declaration as they aren't actually tags. Which makes them somewhat useless as they don't work with things like Timers.
__________________
Not currently working on SourceMod plugin development.
Powerlord is offline
Dr. Greg House
Professional Troll,
Part-Time Asshole
Join Date: Jun 2010
Old 07-28-2014 , 11:41   Re: New API and Syntax
Reply With Quote #57

wtf

Do you actually know the purpose of the
Quote:
Originally Posted by Dr. Greg House View Post
[...]struct-hack.
...which my comment is actually about?

Because none of what you proposed fills that void.
__________________
Santa or Satan?

Watch out when you're paying people for private requests! Most stuff already exists and you can hardly assess the quality of what you'll get, and if it's worth the money.

Last edited by Dr. Greg House; 07-28-2014 at 11:42.
Dr. Greg House is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 07-28-2014 , 11:58   Re: New API and Syntax
Reply With Quote #58

Quote:
Originally Posted by Dr. Greg House View Post
wtf

Do you actually know the purpose of the

...which my comment is actually about?

Because none of what you proposed fills that void.
Since the topic of conversation is the new API/syntax, I assumed your were talking about the new API. Which I guess isn't the case.
__________________
Not currently working on SourceMod plugin development.

Last edited by Powerlord; 07-28-2014 at 11:59.
Powerlord is offline
Dr. Greg House
Professional Troll,
Part-Time Asshole
Join Date: Jun 2010
Old 07-28-2014 , 12:23   Re: New API and Syntax
Reply With Quote #59

Quote:
Originally Posted by Dr. Greg House View Post
There really needs to be something better than the struct-hack.
Listening comprehension at its finest.
Not that there was future talk and requests anyway.
__________________
Santa or Satan?

Watch out when you're paying people for private requests! Most stuff already exists and you can hardly assess the quality of what you'll get, and if it's worth the money.

Last edited by Dr. Greg House; 07-28-2014 at 12:23.
Dr. Greg House is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 07-28-2014 , 13:09   Re: New API and Syntax
Reply With Quote #60

Quote:
Originally Posted by Dr. Greg House View Post
Listening comprehension at its finest.
Not that there was future talk and requests anyway.
Well, there's also the fact that it's blindingly obvious how to do it given the syntax examples already given.

PHP Code:
methodmap MyStruct
{
    
property int MyIntProp {
        public 
native get;
        public 
native set(int newIntVal);
    }

    
property char[32MyStringProp {
        public 
native get;
        public 
native set(char[] newStringVal);
    }
}

// in some other method
    
MyStruct aStruct MyStruct();
    
aStruct.MyIntProp 14;
    
aStruct.MyStringProp "bacon"
__________________
Not currently working on SourceMod plugin development.

Last edited by Powerlord; 07-28-2014 at 13:45.
Powerlord is offline
Reply



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

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

Forum Jump


All times are GMT -4. The time now is 05:16.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode