Exemple #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="args"></param>
        public override LispObject execute(LispObject[] args)
        {
            if (args[0] is Condition)
            {
                Condition cond = (Condition)args[0];
                String    s    = "DESC:\r\n" + cond.getDescription().princToString() + "\r\nMESG:\r\n" + cond.getMessage() + "\r\nRPRT:\r\n" + cond.getConditionReport() + "\r\n";
                DLRConsole.DebugWriteLine(s);
                // if (true) return previous.execute(args);
                if (args[0] is UndefinedFunction)
                {
                    UndefinedFunction u = (UndefinedFunction)args[0];
                    return(ABCLInterpreter.COMMON_ABCLInterpreter.makeFunction(u.getCellName()));
                }
                if (args[0] is UnboundVariable)
                {
                    UnboundVariable u = (UnboundVariable)args[0];
                    return(ABCLInterpreter.COMMON_ABCLInterpreter.makeVariable(u.getCellName()));
                }

                lock (ABCLInterpreter.SubThreadInDebugMutex)
                {
                    bool wasDebugging = ABCLInterpreter.IsSubThreadInDebug;
                    try
                    {
                        ABCLInterpreter.IsSubThreadInDebug = true;
                        previous.execute(args); //throw new ConditionThrowable(cond);
                    }
                    finally
                    {
                        ABCLInterpreter.IsSubThreadInDebug = wasDebugging;
                    }
                }
            }
            throw new MissingMethodException(Lisp.javaString(args[0]));
        } // method: execute
Exemple #2
0
        internal LispObject clojEval(LateSymbolPrimitive lsp, String s, LispObject[] args)
        {
            Object target  = null;
            int    indexOf = s.IndexOf(".");

            if (indexOf > 0)
            {
                String s1 = s.Substring(0, indexOf);
                target = findSymbol(target, s1);
                if (target != null)
                {
                    ((ScriptInterpreter)this).Intern(s1, target);
                }
                Package    pkg = CurrentPackage();
                Symbol     sym = pkg.findAccessibleSymbol(s);
                LispObject sf  = sym.getSymbolFunction();
                if (sf != null)
                {
                    if (sf != lsp)
                    {
                        return(sf.execute(args));
                    }
                }

                s = s.Substring(indexOf + 1);
                Object o = clojExecute(target, s, args);
                return(JavaObject.getInstance(o));
            }
            else
            {
                String s1 = s;
                target = findSymbol(target, s1);
                Object o = clojExecute(target, "", args);
                return(JavaObject.getInstance(o));
            }
        }