Beispiel #1
0
        // callback
        // For when .NET calls back into Scheme.
        public static SObject callback(Procedure p)
        {
            SObject result;
            SObject cont = Cont.getCC();

            try {
                Cont.reset();
                trampoline(p, 0);
                result = Reg.Result;
            }
            finally {
                Cont.setCC(cont);
            }
            return(result);
        }
Beispiel #2
0
        public static void dumpContinuation()
        {
            msg.WriteLine("Continuation:");
            SObject sframe = Cont.getCC();
            int     i      = 0;

            while (sframe is SVL)
            {
                SVL frame = (SVL)sframe;
                dumpFrame(frame.elements, i);
                sframe = frame.elements[Cont.HC_DYNLINK];
                i++;
            }
            msg.WriteLine("  Continuation ended with {0}", sframe);
            msg.WriteLine();
        }
Beispiel #3
0
        public static SObject callback(Procedure p, SObject arg0)
        {
            SObject result;
            SObject cont = Cont.getCC();

            try {
                Cont.reset();
                Reg.setRegister(1, arg0);
                trampoline(p, 1);
                result = Reg.Result;
            }
            finally {
                Cont.setCC(cont);
            }
            return(result);
        }
Beispiel #4
0
        /* ===================================================== */
        /*   Misc                                                */
        /* ===================================================== */

        /* Continuation manipulation */
        /* ------------------------- */

        public static SObject op1_creg(SObject unused)
        {
            return(Cont.getCC());
        }