SyntaxQ["string"]如果该字符串对应于在语法上正确的单个 Mathematica 表达式的输入,那么 SyntaxQ["string"] 返回 True,否则返回 False.
测试一个字符串是否符合有效的 Mathematica 语法:
当 SyntaxQ 给出 True,字符串可以转换为一个表达式:
重复从对话框中要求输入,直到语法上正确为止:
ToExpression SyntaxLength $SyntaxHandler DelimiterFlashTime
400+ new features, including the new Wolfram Predictive Interface, social network analysis, enterprise CDF deployment, and more »