Rakudo.Metamodel.Representations.RakudoCodeRef.type_object_for C# (CSharp) Method

type_object_for() public method

Create a new type object.
public type_object_for ( ThreadContext TC, RakudoObject MetaPackage ) : RakudoObject
TC Rakudo.Runtime.ThreadContext
MetaPackage RakudoObject
return RakudoObject
        public override RakudoObject type_object_for(ThreadContext TC, RakudoObject MetaPackage)
        {
            // Do the usual bits of setup for the type-object.
            var STable = new SharedTable();
            STable.HOW = MetaPackage;
            STable.REPR = this;
            STable.WHAT = new Instance(STable);

            // Also twiddle the S-Table's Invoke to invoke the contained
            // function.
            STable.SpecialInvoke = (TCi, Obj, Cap) =>
                ((RakudoCodeRef.Instance)Obj).Body(TCi, Obj, Cap);

            return STable.WHAT;
        }