示例#1
0
        public bool IsDefined(SymbolAtom sym)
        {
            if (IsDefinedHere(sym))
            {
                return(true);
            }

            if (Parent == null)
            {
                return(false);
            }

            return(Parent.IsDefined(sym));
        }
示例#2
0
        public ISExpression Lookup(SymbolAtom sym)
        {
            if (Data.ContainsKey(sym))
            {
                return(Data[sym]);
            }

            if (Parent != null)
            {
                return(Parent.Lookup(sym));
            }

            return(null);
        }
示例#3
0
 public bool Set(SymbolAtom sym, ISExpression sexpr)
 {
     if (IsDefinedHere(sym))
     {
         DefineHere(sym, sexpr);
         return(true);
     }
     else if (Parent == null)
     {
         return(false);
     }
     else
     {
         return(Parent.Set(sym, sexpr));
     }
 }
示例#4
0
 public void DefineHere(SymbolAtom sym, ISExpression sexpr)
 {
     Data[sym] = sexpr;
 }
示例#5
0
 public bool IsDefinedHere(SymbolAtom sym)
 {
     return(Data.ContainsKey(sym));
 }