TSa Thomas.Sandlass-at-barco.com |Perl 6| wrote:

For functions, types don't need to be treated specially from other arguments
as in C++.

Could you give an example of what you mean in C++ and how Perl differs
from that?

In C++, types are not first-class objects. You can't pass a type as a normal parameter because there is no such thing.

So type parameters are treated differently with their own syntax:


In Perl, you can simply pass

   foo(::C, ::D, x, y, z);

because types are first-class objects. You can define parameters that have a Type type, and use their value to create objects of that type, and even annotate declarations.


Reply via email to