Example #1
0
        private object ResumeWithProcedure(ContextList cList,
                                           Procedure proc, Continuation k)
        {
            object returnValue;

            if (cList.Newer == null)
            {
                try {
                    returnValue = proc.Apply(this, List.Create(k), null);
                } catch (CaptureException capEx) {
                    capEx.AppendContext(cList);
                    throw;
                }
            }
            else
            {
                returnValue = ResumeWithProcedure(cList.Newer, proc, k);
            }

            try {
                return(cList.Current.Invoke(returnValue));
            } catch (CaptureException capEx) {
//System.Console.WriteLine("Older: " + cList.Older.ToString());
                capEx.AppendContext(cList.Older);
                throw;
            }
        }
Example #2
0
        private object ResumeWithValue(ContextList cList, object val)
        {
            object returnValue;

            if (cList.Newer == null)
            {
                returnValue = val;
            }
            else
            {
                returnValue = ResumeWithValue(cList.Newer, val);
            }

            try {
                return(cList.Current.Invoke(returnValue));
            } catch (CaptureException capEx) {
//System.Console.WriteLine("Older: " + cList.Older.ToString());
                capEx.AppendContext(cList.Older);
                throw;
            }
        }