HaxeFoundation / HaxeFoundation/haxe.org-comments

[code.haxe.org] Other - Adding static methods to existing classes

Open
#25 6 comments 0 reactions 0 assignees View on GitHub
Dominant language
No language data
Stars
2
Forks
0
PR merge metrics
No merged PRs in 30d

Description

# Adding static methods to existing classes - Other - Haxe programming language cookbook

Haxe allows you to add static methods to existing classes (eg. Math) via the static extensions feature. The secret sauce is to specify the first parameter of the extension as Class where X is the class you want to add static methods to (eg. Math), and to make the method public.

[https://code.haxe.org/category/other/adding-static-methods-to-existing-classes.html](https://code.haxe.org/category/other/adding-static-methods-to-existing-classes.html)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.