PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Saturday, July 9, 2022

[FIXED] Why are 'new' and 'make' not reserved keywords?

 July 09, 2022     go, identifier, keyword     No comments   

Issue

With syntax highlighting enabled, it's distracting while reading code like answer to this question with new used as a variable name.

I'm trying to think of a reason why only a subset of keywords would be reserved and can't come up with a good one.

Edit: Alternate title for this question:

Why are Go's predeclared identifiers not reserved ?


Solution

That's because new and make aren't really keywords, but built-in functions.

If you examine the full list of the reserved keywords, you won't see len or cap either...



Answered By - Elwinar
Answer Checked By - Candace Johnson (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing