static string UseSExpr(Racr.AstNode n) { return "(~> '" + n.GetName() + ")"; }
static string OrdinaryQuestionSExpr(Racr.AstNode n) { return "(?? '" + n.GetName() + " " + Lexer.EscapeString(n.GetLabel()) + " " + n.Type() + " " + Lexer.EscapeValue(n.Value()) + ")"; }
static string ComputedQuestionSExpr(Racr.AstNode n) { return "(~? '" + n.GetName() + " " + Lexer.EscapeString(n.GetLabel()) + " " + n.GetExpression().SExpr() + ")"; }
static object UseValue(Racr.AstNode n) { return n.FindActive(n.GetName()).Value(); }
static ValueTypes UseType(Racr.AstNode n) { return n.GLookup(n.GetName()).Type(); }
static bool QuestionIsActive(Racr.AstNode n) { return n.IsErrorQuestion() || (n.Parent().IsActive() && n.FindActive(n.GetName()).IsErrorQuestion()); }
static bool QuestionIsLValid(Racr.AstNode n) { if (n.Type() == ValueTypes.ErrorType) return false; var prev = n.GLookup(n.GetName()); return prev.IsErrorQuestion() || n.Type() == prev.Type(); }
static Racr.AstNode QuestionLLookup(Racr.AstNode n, string name) { if (n.GetName() == name) return n; return null; }