proc parameters can have identical names
|
|
BYOND Version: | 507 |
Operating System: | Windows 7 Pro 64-bit |
Web Browser: | Chrome 37.0.2062.124 |
Applies to: | Dream Maker |
|
Status: |
Open
Issue hasn't been assigned a status value.
|
|
|
I am not sure if this is a "feature" or a bug. I was writing some code and noticed that my project locked up when it ran. I tend to use single-letter parameters for procedures (as a convention of mine), and found out that the compiler doesn't care if I happen to use the same name for two different parameters.
What happens is that the second argument that has the same parameter name is used instead of the first (or last if there are more than two).
proc/SomeProc(A="a", B="b", C="c", C="w", D="d") world << "[A] [B] [C] [D]"
client/New() ..() SomeProc() // prints "a b w d" return src
|