Word · Frequency #2410
global
全局标识符
核心释义
globally scoped identifier
- 1.
全局范围的标识符
A globally scoped identifier.
全局范围的标识符
用法In use
You can access this global from any function in the program.
用法提示:这里的 global 是名词,指在整个程序中都可访问的全局标识符。
The developer renamed the global to avoid a naming conflict.
用法提示:global 作名词,表示一个具有全局作用域的标识符。
These globals are defined at the top of the script.
用法提示:globals 是 global 的复数形式,指多个全局标识符。
declare sth as a global
该结构表示把某个变量声明为全局变量,global 前可用 a 或 the。
You can declare the counter as a global if several functions need it.
如果多个函数都需要它,你可以把计数器声明为全局变量。
use a global to do sth
a global 后用不定式说明这个全局变量的用途。
相关词与表达Connections
搭配Collocations
- declare a global
- 声明一个全局标识符
- You need to declare a global before using it in another function.在另一个函数中使用它之前,你需要先声明一个全局标识符。
- define a global
- 定义一个全局标识符
- The program defines a global at the top of the file.程序在文件顶部定义了一个全局标识符。
- access a global
- 访问一个全局标识符
- The function can access a global from anywhere in the module.该函数可以从模块中的任何位置访问一个全局标识符。
- avoid globals
- 避免使用全局标识符
- Experienced programmers often avoid globals to keep code maintainable.有经验的程序员常常避免使用全局标识符,以保持代码可维护。
- set a global
学习提示Learner notes
记忆技巧Memory Tip
记忆联想:global 里藏着 globe(地球)。想象一个抱着地球仪的标识符,整个程序都看得见它——这就是“全局”的那个变量。
语境与语域Context & Register
语域:mixed 常见场景:programming documentation、developer discussion、code review 作名词时多用于计算机编程语境,指在全局作用域中定义的标识符;在技术文档和代码注释中偏正式,在开发者日常交流中也可随意使用,通常不出现在日常英语口语里。
语法说明Grammar Note
作可数名词,指具有全局作用域的标识符;复数形式为 globals。
发音与拼写Pronunciation & Spelling
global 读 /ˈɡloʊbəl/,重音在第一个音节,词尾是非重读的 /bəl/。noble 与 mobile(美式读音)和它押韵,结尾都读 /oʊbəl/。local、legal、label、double 拼写相似但读音不同,并不押韵:local 结尾是 /kəl/,legal 结尾是 /ɡəl/ 且元音不同,label 的重读元音是 /eɪ/,double 的重读元音是 /ʌ/。另外 mobile 在英式英语中常读 /ˈməʊbaɪl/,那就与 global 不押韵了。
高价值词汇High-value vocabulary
该词属于 Oxford 核心词汇,值得优先掌握常见搭配和句型。
Dictionary facts from DICTIONARY_API_DEV, ECDICT, WIKTIONARY.