Raised This Month: $ Target: $400
 0% 

New API and Syntax


Post New Thread Reply   
 
Thread Tools Display Modes
Wliu
Veteran Member
Join Date: Apr 2013
Old 10-16-2015 , 20:46   Re: New API and Syntax
Reply With Quote #611

Something I've noticed while using the new API docs page is that function arguments no longer display their default value if they have one. This is pretty detrimental since 1) you no longer know if you need to include that argument, and 2) there is no way of finding out what the default value is without clicking File.

Old:


New:
__________________
~Wliu
Wliu is offline
Potato Uno
Veteran Member
Join Date: Jan 2014
Location: Atlanta, Georgia
Old 10-16-2015 , 22:37   Re: New API and Syntax
Reply With Quote #612

Yes that has been very annoying. I have to check the old docs to figure out the optional parameters. Specifying in the docs, if not on the prototype, that a function has optional parameters (and if so, their default values) would be really nice.
Potato Uno is offline
BAILOPAN
Join Date: Jan 2004
Old 10-19-2015 , 15:30   Re: New API and Syntax
Reply With Quote #613

The include files show default values. The new documentation parser can't slice out the correct text yet.
__________________
egg
BAILOPAN is offline
Miu
Veteran Member
Join Date: Nov 2013
Old 10-26-2015 , 12:55   Re: New API and Syntax
Reply With Quote #614

why do const vars have to hold constant expressions in 1.7? o.o
Miu is offline
BAILOPAN
Join Date: Jan 2004
Old 10-26-2015 , 14:35   Re: New API and Syntax
Reply With Quote #615

@Miu: I would be surprised if that was a regression (i.e., you should see the same behavior in 1.6) - but if it is, feel free to file a bug. Pawn treats a leading "const" as a compiler constant rather than a variable with immutable storage. So it requires that the expression evaluates at compile-time (and Pawn only supports primitive cells as constants).

The experimental v2 parser does change this, but I'm not aware that the behavior was different in earlier releases.
__________________
egg

Last edited by BAILOPAN; 10-26-2015 at 14:36.
BAILOPAN is offline
Miu
Veteran Member
Join Date: Nov 2013
Old 10-26-2015 , 15:28   Re: New API and Syntax
Reply With Quote #616

there's no regression if you think new syntax "const int var" corresponds to old syntax "const var"; I was just thinking about "new const var"

by 1.7 I meant transitional syntax btw, I don't think there's a change between the compilers
Miu is offline
BAILOPAN
Join Date: Jan 2004
Old 10-26-2015 , 16:38   Re: New API and Syntax
Reply With Quote #617

Ah - yeah, in Transitional Syntax I think the old behaviour is counter-intuitive. I haven't decided whether it's worth changing in spcomp yet.
__________________
egg
BAILOPAN is offline
nergal
Veteran Member
Join Date: Apr 2012
Old 10-26-2015 , 22:57   Re: New API and Syntax
Reply With Quote #618

not to hijack the current subtopic but will the keyword "any" be changed in the future?
__________________
nergal is offline
Potato Uno
Veteran Member
Join Date: Jan 2014
Location: Atlanta, Georgia
Old 10-26-2015 , 23:43   Re: New API and Syntax
Reply With Quote #619

From a technical standpoint, is 1.7 basically the same as 1.6 except spcomp does some voodoo magic that transforms methodmap code or new syntax declarations back to the same bytecode as if the source code was written in 1.6? (If that even makes any sense - I think you get what I mean.)
Potato Uno is offline
asherkin
SourceMod Developer
Join Date: Aug 2009
Location: OnGameFrame()
Old 10-27-2015 , 03:24   Re: New API and Syntax
Reply With Quote #620

Quote:
Originally Posted by nergal View Post
not to hijack the current subtopic but will the keyword "any" be changed in the future?
Yes, its replacement is still undecided I believe.

Quote:
Originally Posted by Potato Uno View Post
From a technical standpoint, is 1.7 basically the same as 1.6 except spcomp does some voodoo magic that transforms methodmap code or new syntax declarations back to the same bytecode as if the source code was written in 1.6? (If that even makes any sense - I think you get what I mean.)
Regarding only SourcePawn, yes. (Obviously there are numerous other changes between 1.6.x and 1.7.x than the introduction of the Transitional Syntax.)
__________________
asherkin 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 20:11.


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