diff --git a/Project.toml b/Project.toml index 3841ce1..917f65d 100644 --- a/Project.toml +++ b/Project.toml @@ -8,6 +8,6 @@ MathLink = "18c93696-a329-5786-9845-8443133fa0b4" SyntaxTree = "a4af3ec5-f8ac-5fed-a759-c2e80b4d74cb" [compat] -MathLink = "=0.5.1" +MathLink = "0.5.2" SyntaxTree = "1.0.1" julia = "1.8" diff --git a/src/WolframExpr.jl b/src/WolframExpr.jl index 4f8a11d..a6ae0f0 100644 --- a/src/WolframExpr.jl +++ b/src/WolframExpr.jl @@ -66,11 +66,11 @@ Very shallow wrapper around `MathLink`'s parsing. julia> using WolframExpr julia> string_to_wexpr("Sin[1]") -W"Sin"(1) +W`Sin[1]` ``` """ -function string_to_wexpr(string) - MathLink.W`$string` +function string_to_wexpr(string)::Union{MathLink.WSymbol,MathLink.WExpr} + MathLink.parseexpr(string) end """ @@ -84,7 +84,7 @@ Convert a Wolfram expression from a `MathLink.WExpr` to a Julia expression. julia> using MathLink, WolframExpr julia> wexpr_to_expr(W`1. + 1`) -:(1.0 + 1) +:(1.0 + 1.0) ``` """ function wexpr_to_expr(symb::MathLink.WSymbol)