View Issue Details

IDProjectCategoryView StatusLast Update
0000120Gameplay + OpenGL[All Projects] Featurepublic2017-01-25 12:57
ReporterMarrub 
Assigned To 
PrioritynormalSeverityfeatureReproducibilityN/A
Status closedResolutionno change required 
Summary0000120: Add identifier scoping to ZScript
DescriptionC is nice and lets you do this:
typedef int i;

int main(int argc, char **argv)
{
   i i = 1;
i:;
   goto i;
   return 0;
}


ZScript, however, lacks this concept, and due to its case insensitivity makes this code really bad:


class A {}
// in some function...
   A a; // error! aagh


If the language didn't have case insensitivity this wouldn't be as much of an issue because of ZScript's tendency to use Unreal class and variable naming; but without proper identifier scoping or case sensitivity this gets really annoying sometimes.
TagsZScript

Relationships

Activities

Graf Zahl

Graf Zahl

2017-01-25 12:56

administrator   ~0000235

It's not a bug - it's a feature! :P

Seriously, naming variables the same as types is an open invitation to errors and requires a completely different level of parsing complexity. I wish I could undo the case insensitivity but that's so deeply ingrained in the code I inherited that it's not undoable.

Issue History

Date Modified Username Field Change
2017-01-25 12:43 Marrub New Issue
2017-01-25 12:45 Marrub Tag Attached: ZScript
2017-01-25 12:56 Graf Zahl Note Added: 0000235
2017-01-25 12:57 Graf Zahl Status new => closed
2017-01-25 12:57 Graf Zahl Resolution open => no change required
2017-01-29 21:18 Rachael Category Suggestion => Feature