Stay organized with collections
Save and categorize content based on your preferences.
blockly > Names > NameType
Names.NameType enum
Enum for the type of a name. Different name types may have different rules about collisions. When JavaScript (or most other languages) is generated, variable 'foo' and procedure 'foo' would collide. However, Blockly has no such problems since variable get 'foo' and procedure call 'foo' are unambiguous. Therefore, Blockly keeps a separate name type to disambiguate. getName('foo', 'VARIABLE') = 'foo' getName('foo', 'PROCEDURE') = 'foo2'
Signature:
enum NameType
Enumeration Members
Member |
Value |
Description |
DEVELOPER_VARIABLE |
"DEVELOPER_VARIABLE" |
|
PROCEDURE |
"PROCEDURE" |
|
VARIABLE |
"VARIABLE" |
|
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-09-18 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-09-18 UTC."],[],["The `NameType` enum in Blockly differentiates between name types, allowing for the same name to be used for different purposes without collision. It includes `DEVELOPER_VARIABLE`, `PROCEDURE`, and `VARIABLE` members. This distinction is necessary because while languages like JavaScript would consider a variable and procedure with the same name as a conflict, Blockly can differentiate, assigning unique identifiers like `foo` and `foo2` to `VARIABLE` and `PROCEDURE` name types, respectively.\n"]]