Syntax Update: Removals
Hi All,
After letting the new syntax make its rounds, there are a few adjustments I'd like to make. Nothing new in this post, only removals (sorry!) Intrinsic Handle Handle will no longer have a methodmap in handles.inc. It will be a compiler intrinsic. You will still be able to delete and Close() it (although Clone has been removed as a method). Removing Destructors These were intended for extensions, but they were difficult to support in the language without exposing terrible things (like, potentially, object resurrection if we ever do GC). Instead, destructors will go away entirely. You can still use delete on Handles because they're now intrinsic. Neutering __nullable__ For such an important piece of future type system sanity, this one was a pretty bad leak. It was undocumented but that didn't stop people from creating alternate nullable systems that violated its intended semantics. __nullable__ will still allow using new with custom constructors, but it won't allow comparing to null. Removing () = binding When we were first prototyping methodmaps, we added a shortcut method declaration syntax, called "method binding". It looks like this: NewMethod () = OldMethod. This syntax is incredibly annoying to support in the compiler, and our docgen tools don't support it at all. Our own usage of it is almost gone in the 1.7 branch. So, I will attempt to just remove it entirely in 1.8. There are three ways to fix up your methodmaps. One is to just write wrapper functions that call the old function. Two is to just delete the old function and move any lingering code into methodmap-land. Finally, if you are an extension, you can create another native binding. For example, PHP Code:
PHP Code:
(This change will definitely not be backported to 1.7.) Requiring parens on view_as<> A mistake in the implementation of view_as<> allowed using it without parenthesizing the affected expression. This has been fixed already on 1.8. |
Re: Syntax Update: Removals
I was wondering y DataPack and Handle methodmaps were the only 2 methodmaps I found in 1.7 that did the method binding while all others didn't
|
Re: Syntax Update: Removals
The answer is we were lazy.
|
Re: Syntax Update: Removals
Quote:
|
Re: Syntax Update: Removals
Quote:
|
Re: Syntax Update: Removals
Quote:
Also shit, does that mean I should expect my plugins with #pragma newdecls required to not compile under 1.8? Should I expect possibly more things to be gone from 1.7? I'm guilty of not using parentheses under view_as<type>. |
Re: Syntax Update: Removals
Anything requiring newdecls should continue to work. Only what has been noted above is changing.
|
Re: Syntax Update: Removals
Quote:
CBasePlayer player = new CBasePlayer( client ); edit: in case this is a bug and not just another syntactic miss on my part, if I modify https://github.com/alliedmodders/sou...e-methodmap.sp to PHP Code:
//// test-nullable.sp // // test-nullable.sp(29) : error 171: cannot use 'new' with non-object-like methodmap 'King' // test-nullable.sp(29) : warning 213: tag mismatch // test-nullable.sp(32) : error 171: cannot use 'new' with non-object-like methodmap 'Layer3' // test-nullable.sp(32) : warning 213: tag mismatch // |
All times are GMT -4. The time now is 17:08. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.