View Single Post
Steell
SourceMod Donor
Join Date: Mar 2009
Old 08-08-2012 , 14:14   Re: Dynamic Arrays in SourcePawn
Reply With Quote #31

Quote:
Originally Posted by BAILOPAN View Post
Note that arrays will always be passed by reference to functions no matter what, so you don't have to worry about that.
Right, but if we're using @ to denote array references when declaring new variables, then I feel that everywhere we're dealing with references we should also use @ to remain consistent; even though there's no functional point in including @ in function parameters, for example, new Sourcepawn 2 users will see function headers without @ for arrays and assume that they're passed by-value, since declaring new arrays without the @ means precisely that.

For proposal 4, if we include @ in function parameters for arrays, then although it's consistent and easier to read, it's extra work for the user writing the code. Since it's always pass-by-reference then we could always omit the @ in function parameters for arrays, but then it's syntactically inconsistent with array references everywhere else.

In summary: minor nitpicking about syntax.
__________________
Steell is offline