博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
class-metaclass-Class vs. type
阅读量:5758 次
发布时间:2019-06-18

本文共 1689 字,大约阅读时间需要 5 分钟。

In some languages, classes are only a compile-time feature (new classes cannot be declared at runtime), while in other languages classes are , and are generally themselves objects (typically of type Class or similar). In these languages, a class that creates classes is called a .

 

Class vs. type[]

In casual use, people often refer to the "class" of an object, but narrowly speaking objects have type: the interface, namely the types of member variables, the signatures of  (methods), and properties these satisfy. At the same time, a class has an implementation (specifically the implementation of the methods), and can create objects of a given type, with a given implementation. In the terms of type theory, a class is an implementation‍—‌a concrete  and collection of subroutines‍—‌while a type is an . Different (concrete) classes can produce objects of the same (abstract) type (depending on type system); for example, the type Stack might be implemented with two classes –  SmallStack (fast for small stacks, but scales poorly) and ScalableStack (scales well but high overhead for small stacks). Similarly, a given class may have several different constructors.

 

Metaclasses[]

Metaclasses are classes whose instances are classes. A metaclass describes a common structure of a collection of classes and can implement a  or describe particular kinds of classes. Metaclasses are often used to describe .

In some languages, such as ,  or , a class is also an object; thus each class is an instance of a unique metaclass that is built into the language.   The  (CLOS) provides  (MOPs) to implement those classes and metaclasses. 

 

https://en.wikipedia.org/wiki/Class_(computer_programming)

转载地址:http://esvkx.baihongyu.com/

你可能感兴趣的文章
Beego框架之参数配置与路由配置
查看>>
http1.1 header回顾总结下
查看>>
利用Python编写Windows恶意代码!自娱自乐!勿用于非法用途!
查看>>
数据库的设计
查看>>
MySQL导入sql脚本错误:2006 - MySQL server has gone away
查看>>
hdu_1864
查看>>
ansible使用方法
查看>>
JavaScript实现注册模块功能
查看>>
关于tomcat 多个配置多个host加载多次,导致initSerlet加载多次
查看>>
寻找中国音视频开发行业的翘楚
查看>>
让域控制器向DNS服务器注册SRV记录
查看>>
第9章 使用PKI实现邮件安全
查看>>
C语言实现SDK窗口编程
查看>>
摄影用户的使针对UI设计师做最优设计
查看>>
fullPage
查看>>
Linux基础命令---sar显示系统活动信息
查看>>
SCCM部署(六)---ADK及服务器扩展
查看>>
oracle控制文件损坏恢复
查看>>
使用Python将sql文件刷入DB
查看>>
我的友情链接
查看>>