EhhLang Help

Ehhlang Inheritance

Introduction

Ehhlang supports inheritance, which allows you to create new objects from existing objects. This document will cover the inheritance feature of Ehhlang and how to use it.

Inheritance

Inheritance is a mechanism in which a new class (or object) is created from an existing class (or object). The new class (or object) is called the child class (or object), and the existing class (or object) is called the parent class (or object).

In Ehhlang, inheritance is represented by the :: operator. You can use the :: operator to create a new object from an existing object. The new object inherits all the properties of the existing object and can have its own properties as well.

Example

text :: HelloEhh { fontScale: 5 thickness: 5 color: 255, 255, 255 position: 100, 100 text: "Hello Ehh!!!" } HelloEhh :: HelloWorld { position: 200, 200 text: "Hello World!!!" }

In the above example, we have created a new object HelloEhh from the existing object text. The HelloEhh object inherits all the properties of the text object and has its own properties position and text.

We have also created a new object HelloWorld from the existing object HelloEhh. The HelloWorld object inherits all the properties of the HelloEhh object and has its own properties position and text.

Conclusion

Inheritance is a powerful feature of Ehhlang that allows you to create new objects from existing objects. It helps you to reuse code and create new objects with minimal effort. You can use inheritance to create complex objects from simple objects and build a hierarchy of objects.

Last modified: 25 February 2024