Package Rakudo.Metamodel

Examples of Rakudo.Metamodel.RakudoObject


        else
            return 0;

        /* Analyse each parameter in the two candidates. */
        for (i = 0; i < TypesToCheck; i++) {
            RakudoObject TypeObjA = a.Sig.Parameters[i].Type;
            RakudoObject TypeObjB = b.Sig.Parameters[i].Type;
            if (TypeObjA == TypeObjB)
            {
                /* In a full Perl 6 multi dispatcher, you'd consider
                 * constraints here. */
                Tied++;
View Full Code Here


    /// </summary>
    public static ThreadContext Initialize(String settingName)
    {
        // Bootstrap the meta-model.
        RegisterRepresentations();
        RakudoObject knowHOW = KnowHOWBootstrapper.Bootstrap();
        RakudoObject knowHOWAttribute = KnowHOWBootstrapper.SetupKnowHOWAttribute(knowHOW);

        // Either load a named setting or use the fake bootstrapping one.
        Context settingContext =
            // Comment out the next line to always use the fake Setting.
            (settingName != null) ? LoadSetting(settingName, knowHOW, knowHOWAttribute) :
View Full Code Here

                REPRRegistry.get_REPR_by_name("P6list").type_object_for(null,null),
                REPRRegistry.get_REPR_by_name("RakudoCodeRef").type_object_for(null,knowHOW.getSTable().REPR.instance_of(null,knowHOW)),
                CodeObjectUtility.WrapNativeMethod(new RakudoCodeRef.IFunc_Body() // C# has a lambda instead of the anonymous class
                    {
                        public RakudoObject Invoke(ThreadContext tc, RakudoObject self, RakudoObject capture) {
                            RakudoObject nqpList = Ops.get_lex(tc, "NQPList");
                            P6list.Instance list = (P6list.Instance)nqpList.getSTable().REPR.instance_of(tc, nqpList);
                            P6capture.Instance nativeCapture = (P6capture.Instance)capture;
                            for (RakudoObject obj : nativeCapture.Positionals)
                                list.Storage.add(obj);
                            return list;
                        }
View Full Code Here

                { // C# has a => (lambda)
                    public RakudoObject Invoke(ThreadContext tc, RakudoObject self, RakudoObject capture)
                    {
                        for (int i = 0; i < CaptureHelper.NumPositionals(capture); i++)
                        {
                            RakudoObject value = CaptureHelper.GetPositional(capture, i);
                            RakudoObject strMeth = self.getSTable().FindMethod(tc, value, "Str", 0);
                            RakudoObject strVal = strMeth.getSTable().Invoke(tc, strMeth,
                                CaptureHelper.FormWith( new RakudoObject[] { value } ));
                            System.out.print(Ops.unbox_str(null, strVal));
                        }
                        return CaptureHelper.Nil();
                    }
                }
        ));
        settingContext.LexPad.SetByName("say",
            CodeObjectUtility.WrapNativeMethod( new RakudoCodeRef.IFunc_Body()
                { // C# has a => (lambda)
                    public RakudoObject Invoke(ThreadContext tc, RakudoObject self, RakudoObject capture)
                    {
                        for (int i = 0; i < CaptureHelper.NumPositionals(capture); i++) {
                            RakudoObject value = CaptureHelper.GetPositional(capture, i);
                            RakudoObject strMeth = self.getSTable().FindMethod(tc, value, "Str", 0);
                            RakudoObject strVal = strMeth.getSTable().Invoke(tc, strMeth,
                                CaptureHelper.FormWith( new RakudoObject[] { value } ));
                            System.out.print(Ops.unbox_str(null, strVal));
                        }
                        System.out.println();
                        return CaptureHelper.Nil();
View Full Code Here

TOP

Related Classes of Rakudo.Metamodel.RakudoObject

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.