|
Problem:
You want to use an object as if it were a Class. For example, you want to use Solution:
Just do it:
Discussion: An object is, by definition, nothing more than a specific instance of a builtin type or class. You may call class methods within an object just as you would call any other method: when the method is called, it will use the class of the object, and instance information will be unavailable. In perl5, the first argument to a method was either a class name or an object instance, depending on how the method had been called. This led to code like:
For class methods in perl6, the step of converting an object to a class name is done automatically when you call a class method on an object instance.
|