Lua是一种面向对象的语言吗? [英] Is Lua an object-oriented language?

查看:96
本文介绍了Lua是一种面向对象的语言吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

该语言是OO语言吗? 它经常用作OO语言吗?

Is this language an OO language? Is it often used as OO language?

推荐答案

Lua完全有能力原型的基于对象的编程,类似于JavaScript.

Lua is fully capable of prototype-based object-oriented programming similar to JavaScript.

基于原型的编程是一种风格 中的面向对象编程 哪些课程不存在,以及 行为重用(称为继承) 以基于班级的语言) 通过克隆现有的过程 用作原型的对象.这 模型也可以称为无类 面向原型或基于实例 编程.委派是 支持的语言功能 基于原型的编程.

Prototype-based programming is a style of object-oriented programming in which classes are not present, and behavior reuse (known as inheritance in class-based languages) is performed via a process of cloning existing objects that serve as prototypes. This model can also be known as class-less, prototype-oriented or instance-based programming. Delegation is the language feature that supports prototype-based programming.

有关更多信息,请参见第16章-面向对象编程 href ="http://www.lua.org/pil/" rel ="noreferrer"> 在Lua中编程 这本书.

For more information, see Chapter 16 - Object-Oriented Programming of the Programming in Lua book.

这篇关于Lua是一种面向对象的语言吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆