View Single Post
rhelgeby
Veteran Member
Join Date: Oct 2008
Location: 0x4E6F72776179
Old 08-08-2012 , 15:02   Re: Dynamic Arrays in SourcePawn
Reply With Quote #34

Assuming this is for SourcePawn 2 or whatever it's going to be called, so existing SourceMod plugins will still keep its own language?

In that case I'd go for proposal 1 because it's simple and strict. Provide a helper function to get a copy of the array. Maybe something like this:

PHP Code:
new myArray[] = {123};
new 
secondArray[];

secondArray myArray.copyOf();

// copyOf creates a copy of the array and returns the reference to it. 
Maybe a better name than copyOf, but I suppose you get my point.

To me, the assignment operator only seems logical to use when you're assigning a single value (primitive or reference) to a variable. It doesn't seem right to assign a bunch of values at once, it's too magical.
__________________
Richard Helgeby

Zombie:Reloaded | PawnUnit | Object Library
(Please don't send private messages for support, they will be ignored. Use the forum.)

Last edited by rhelgeby; 08-08-2012 at 15:06.
rhelgeby is offline
Send a message via MSN to rhelgeby