private void updateParent(ref SchemeAST currentAST, SchemeObject newValue) { /* if (currentAST.currentObject.GetType() == typeof(SchemeLambda)) { // foreach (SchemeType obj in currrentEn ) foreach (string key in currentEnvironment.getDict().Keys) { currentEnvironment.parent().set(new SchemeSymbol(key), currentEnvironment.getDict()[key]); } } */ if (currentAST.hasOwnEnviornment)// && currentEnvironment.parent() != null ) { /* if (newValue is SchemeLambda) { foreach (string key in currentEnvironment.getDict().Keys) { currentEnvironment.parent().set(new SchemeSymbol(key), currentEnvironment.getDict()[key]); } } */ currentEnvironment = currentEnvironment.parent(); } int postition = currentAST.parent.children.IndexOf(currentAST); currentAST.parent.children.Remove(currentAST); // if( newValue != SchemeVoid.instance ) // { var returnValue = new SchemeAST(currentAST.parent, newValue); currentAST.parent.children.Insert(postition, returnValue); // } }
public SchemeList(SchemeObject car) { this.car = car; this.cdr = SchemeNil.instance; }
public SchemeAST( SchemeAST parent, SchemeObject currentObject ) { // Debug.Assert( parent != null && currentObject != null ); _parent = parent; this.currentObject = currentObject; }
public SchemeList(SchemeObject foo, SchemeObject bar) { this.car = foo; this.cdr = bar; }