当前位置:网站首页>Lua middle__ index、__ Understanding of newindex, rawget and rawset
Lua middle__ index、__ Understanding of newindex, rawget and rawset
2022-07-28 11:57:00 【Walking on the top of the clouds】
All premises , Set up tab The meta table of is meta, When the found value or the assigned value does not exist , Meta table meta Go check __index perhaps __newindex Whether there is .
__index: When you need to call a function or variable that does not exist in the current table , Look up the meta table and call it .

rawget: Give Way __index invalid , Get the real value . The significance here lies in , Due to the existence of meta table , To get the true value, you need to use this method .

__newindex : When you need to assign a function or variable that does not exist in the current table , Assign values to the meta table .

rawset: When there is a meta table ,__newindex There is , If not used rawset Assign a value to that nonexistent value , Will be carried out in __newindex Infinite assignment of , Dead cycle .

边栏推荐
- [diary of supplementary questions] [2022 Niuke summer multi school 2] i-let fat tension
- An example of the mandatory measures of Microsoft edge browser tracking prevention
- 「以云为核,无感极速」第五代验证码重磅来袭
- 保障邮箱安全,验证码四个优势
- How to deal with invalid objects monitored by Oracle every day in the production environment?
- 程序的存储态与运行态
- Zotero document manager and its use posture (updated from time to time)
- [geek challenge 2019] babysql-1 | SQL injection
- Article summary of MinGW installation and use
- jar 包内文件的遍历以及文件的拷贝
猜你喜欢

Consumer installation and configuration

tolua之wrap文件的原理与使用

A hundred flowers bloom in data analysis engines. Why invest heavily in Clickhouse?

Today's sleep quality record 74 points

Lua对table进行深拷贝

What is the process of switching c read / write files from user mode to kernel mode?

拥抱开源指南

Design a system that supports millions of users
![[pyGame practice] the super interesting bubble game is coming - may you be childlike and always happy and simple~](/img/3b/c06c140cd107b1158056e41b954e2e.png)
[pyGame practice] the super interesting bubble game is coming - may you be childlike and always happy and simple~

Training mode and practice of digital applied talents in Colleges and Universities under the integration of industry and education
随机推荐
Software testing and quality learning notes 1 --- black box testing
Will PFP be the future of digital collections?
Can dynamic partitions be configured when MySQL is offline synchronized to ODPs
【补题日记】[2022杭电暑期多校2]K-DOS Card
14. User web layer services (II)
一些知识概念
ES6知识点补充
R language uses dplyr package group_ By function and summarize function calculate the mean value of all covariates involved in the analysis based on grouped variables (difference in means of covariate
async await如何实现并发
[diary of supplementary questions] [2022 Niuke summer school 2] h-take the elevator
Are interviews all about memorizing answers?
Simple selection sort and heap sort
Lua对table进行深拷贝
Learn to use MySQL explain to execute the plan, and SQL performance tuning is no longer difficult
Excel shortcut keys (letters + numbers) Encyclopedia
Know the optical fiber interface and supporting optical fiber cable of can optical fiber converter in fire alarm networking
consul安装与配置
The fifth generation verification code of "cloud centered, insensitive and extremely fast" is coming heavily
[pyGame practice] the super interesting bubble game is coming - may you be childlike and always happy and simple~
Untiy中控制Animation的播放速度