当前位置:网站首页>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 .

边栏推荐
- 从0开发一个自己的npm包
- Autumn recruit offer harvesters, and take the offers of major manufacturers at will
- MySQL (version 8.0.16) command and description
- Can dynamic partitions be configured when MySQL is offline synchronized to ODPs
- [diary of supplementary questions] [2022 Hangdian summer school 2] k-dos card
- 「以云为核,无感极速」第五代验证码重磅来袭
- Upgrading of computing power under the coordination of software and hardware, redefining productivity
- Simple selection sort and heap sort
- A lock faster than read-write lock. Don't get to know it quickly
- Reflect 机制获取Class 的属性和方法信息
猜你喜欢

瑞吉外卖——Day01

In order to ensure the normal operation of fire-fighting equipment in large buildings, the power supply monitoring system of fire-fighting equipment plays a key role

Dialogue with Zhuang biaowei: the first lesson of open source

Hcip day 6 (OSPF related knowledge)

consul安装与配置

一文看懂设备指纹如何防篡改、防劫持

Lua对table进行深拷贝

AlexNet—论文分析及复现

可视化大型时间序列的技巧。

Untiy中控制Animation的播放速度
随机推荐
[general database integrated development environment] Shanghai daoning provides you with Aqua Data Studio downloads, tutorials, and trials
R language - some metrics for unbalanced data sets
Alexnet - paper analysis and reproduction
A hundred flowers bloom in data analysis engines. Why invest heavily in Clickhouse?
Let me think about Linear Algebra: a summary of basic learning of linear algebra
Techniques for visualizing large time series.
直接插入排序与希尔排序
Deployment and use of Minio distributed object storage
How async await implements concurrency
Why does acid food hurt teeth + early periodontitis
R language ggplot2 visualization: use the ggdotplot function of ggpubr package to visualize the grouped dot plot, set the palette parameter, and set the color of data points in different grouped dot p
Skiasharp's WPF self drawn drag ball (case version)
Business visualization - make your flowchart'run'(4. Actual business scenario test)
Unity遇坑记之 ab包卸载失败
Leecode8 string conversion integer (ATOI)
PFP会是数字藏品的未来吗?
Minikube initial experience environment construction
[diary of supplementary questions] [2022 Niuke summer school 2] h-take the elevator
AlexNet—论文分析及复现
Interfaces and abstract classes