Everything is an object

Everything is an object

In Crystal everything is an object. The definition of an object boils down to these points:

  • It has a type
  • It can respond to some methods

This is everything you can know about an object: its type and whether it responds to some method.

An object's internal state, if any, can only be queried by invoking methods.

To the extent possible under law, the persons who contributed to this workhave waived
all copyright and related or neighboring rights to this workby associating CC0 with it.
https://crystal-lang.org/docs/syntax_and_semantics/everything_is_an_object.html

在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

意见反馈
返回顶部