O'Reilly logo

haXe 2 by Benjamin Dasnois

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

The dynamic keyword

In haXe code you will sometimes meet the dynamic keyword (all in lowercase). It doesn't have a lot of things to do with the Dynamic type and only appears when declaring a function. It does mean that a method can be rebound. That is, it is possible to change the body of the function.

This keyword is necessary because on some platforms, those methods have to be generated in a special way that can induce some cost on performance.

Here is an example of how to declare such a function:

public dynamic function myFunction()
{
//Do things }

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required