Why does a programming language need keywords?

前端 未结 13 703
野性不改
野性不改 2021-02-01 03:25

For example (in C):

int break = 1;
int for = 2;

Why will the compiler have any problems at all in deducing that break and fo

相关标签:
13条回答
  • 2021-02-01 03:54

    I guess it look very weird if not impossible to write the parser. E.g

    int break = 1;
    while (true) {
       // code to change break
       if (!break) break;   // not very readable code.
    }
    
    0 讨论(0)
提交回复
热议问题