public IExpr evaluate(final IAST ast) { Validate.checkSize(ast, 3); if (ast.get(1).isSymbol()) { if (ast.get(2).isAST("Blank")) { IAST blank = (IAST) ast.get(2); if (blank.size() == 1) { return F.$p((ISymbol) ast.get(1)); } if (blank.size() == 2) { return F.$p((ISymbol) ast.get(1), blank.get(1)); } } if (ast.get(2).isPattern()) { IPattern blank = (IPattern) ast.get(2); if (blank.isBlank()) { return F.$p((ISymbol) ast.get(1), blank.getCondition()); } } } return null; }
public int visit(IPattern element) { return element.hashCode(); }