Clipp can use both c++ constructors and free functions as basis to create a scripting constructor.

If we go back to our point example:

    point::point(double x,double y,double z);

    //function working like a constructor
    point* create_point(double x,double y,double z);	

We can then expose these to the scripting in the following way:

    //expose constructor
    //Optional syntax

    //expose function working like a constructor

In javascript, a constructor can be used both in a new expression, and in a call expression

    var a=new point(5,6,7);	//new expression
    var b=point(5,6,7);		//call expression

This is the default behaviour for constructor registering today. If you want to change the constructor to be used only in new expressions, you have to add the argument construct_method  to the constructor exposing function:

    //Ensure that the constructor can only be used in new expressions

We can also expose create_point as a global function that will only be activated in call expressions:

    //expose function working like a constructor