@@ -4395,7 +4395,7 @@ public static IAST Symmetric(final IExpr a0) {
43954395 }
43964396
43974397 /**
4398- * Converts an arbitrary expression to a type that can be used inside Symja.
4398+ * Converts and evaluates arbitrary expressiona to a Symja type .
43994399 *
44004400 * <pre>
44014401 * Java Object -> Symja object
@@ -4423,20 +4423,41 @@ public static IAST Symmetric(final IExpr a0) {
44234423 *
44244424 */
44254425 public static IExpr symjify (final Object object ) {
4426- return Object2Expr .convert (object );
4426+ return symjify (object , true );
4427+ }
4428+
4429+ public static IExpr symjify (final Object object , boolean evaluate ) {
4430+ IExpr temp = Object2Expr .convert (object );
4431+ return evaluate ? eval (temp ) : temp ;
4432+ }
4433+
4434+ /**
4435+ * Parses and evaluates a Java string to a Symja expression. May throw an SyntaxError exception, if the string couldn't be parsed.
4436+ *
4437+ * @param str
4438+ * the epression which should be parsed
4439+ * @return
4440+ * @throws SyntaxError
4441+ */
4442+ public static IExpr symjify (final String str ) throws SyntaxError {
4443+ return symjify (str , true );
44274444 }
44284445
44294446 /**
44304447 * Parses a Java string to a Symja expression. May throw an SyntaxError exception, if the string couldn't be parsed.
44314448 *
44324449 * @param str
44334450 * the epression which should be parsed
4451+ * @param evaluate
4452+ * if true evaluate the parsed string
44344453 * @return
44354454 * @throws SyntaxError
44364455 */
4437- public static IExpr symjify (final String str ) throws SyntaxError {
4438- ExprParser parser = new ExprParser (EvalEngine .get ());
4439- return parser .parse (str );
4456+ public static IExpr symjify (final String str , boolean evaluate ) throws SyntaxError {
4457+ EvalEngine engine = EvalEngine .get ();
4458+ ExprParser parser = new ExprParser (engine );
4459+ IExpr temp = parser .parse (str );
4460+ return evaluate ? engine .evaluate (temp ) : temp ;
44404461 }
44414462
44424463 public static IExpr symjify (final long value ) {
0 commit comments