Пример #1
0
        public Symbol Intern(string p, object globalcogbotTextForm, List <object> exceptFor, java.lang.Class ic, int depth)
        {
            Package pkg = CurrentPackage();

            if (p == null)
            {
                p = ic.getName();
                p = p.ToString();
            }
            p = p.ToUpper();
            Symbol     s  = Lisp.intern(p, pkg);
            LispObject sv = s.getSymbolValue();

            if (sv is JavaObject)
            {
                if (sv.javaInstance() == globalcogbotTextForm)
                {
                    return(s);
                }
            }
            Symbol fun  = pkg.findAccessibleSymbol("SYMBOL-JOBJECT");
            String mask = String.Format("{0} {1}", p, ic.getName());

            if (fun != null && !allExceptFor.Contains(mask))
            {
                allExceptFor.Add(mask);
                LispObject vtemp = s.getSymbolValue();
                s.setSymbolValue(s);
                var jclass = JavaObject.getInstance(ic);
                Lisp.eval(Lisp.list4(fun, new SimpleString(p), s, jclass));
                s.setSymbolValue(vtemp);
                depth++;
            }
            if (globalcogbotTextForm != null)
            {
                LispObject jo = JavaObject.getInstance(globalcogbotTextForm);
                s.setSymbolValue(jo);

                if (exceptFor.Contains(globalcogbotTextForm))
                {
                    return(s);
                }
                exceptFor.Add(globalcogbotTextForm);
            }

            if (true)
            {
                return(s);
            }

            String ns = ic.getName();

            if (!useClassname(ns))
            {
                return(s);
            }
            if (depth > 0)
            {
                AddMembers(p, s, ic, exceptFor, depth - 1);
            }
            return(s);
        }