Comments (8)
As the W2Julia
function solves the original issue is will close this ticket.
from mathlink.jl.
You can just access the .args
field of the returned object, but that is probably not ideal. This is related to #22.
from mathlink.jl.
I guess there is no harm in making them iterable and defining getindex
on them? then you could just call collect
?
from mathlink.jl.
Would there be any efficiency issues (e.g unnecessary copying)?
from mathlink.jl.
Yes, but we already copy so much stuff it probably wouldn’t make much difference.
from mathlink.jl.
Ok, then that seems fine, intuitive (I did try calling collect
initially to see if it would work), and certainly better than the current situation.
Would it be at-all useful to define specialized collect
methods that would just return args
when we detect that it is already an array?
from mathlink.jl.
we may want a different function, since collect
doesn't alias even for arrays:
julia> X = rand(3);
julia> collect(X) === X
false
parent
is often used for similar things, and might make sense?
from mathlink.jl.
Hi @jebej , based on ticket (#72) I have snuck in the feature (W2Julia
) in into the 0.5.3 release of yesterday (https://github.com/JuliaInterop/MathLink.jl/releases/tag/v0.5.3). It aims to convert MathLink objects to Julia style objects.
At the moment it can convert the "Assumptions" to a dictionary and lists to a list. Below are some examples:
@test W2Julia(W`{1,2,3}`) == [1,2,3]
@test W2Julia(W`{1,a,3}`) == [1,W"a",3]
@test W2Julia(W`{1,a,{1,2}}`) == [1,W"a",[1,2]]
@test W2Julia(W`Association["team" -> "HOU", "lastName" -> "Ching"]`) == Dict( "team" => "HOU" , "lastName" => "Ching")
@test W2Julia(W`Association["team" -> {1,2,3}, "lastName" -> "Ching"]`) == Dict( "team" => [1,2,3] , "lastName" => "Ching")
@test W2Julia(W`{1,Association["team" -> {1,2,3}, "lastName" -> "Ching"]}`) == [1,Dict( "team" => [1,2,3] , "lastName" => "Ching")]
As this is almost at the embryo stage, feel free to report strange (or lacking) behavior i other tickets.
from mathlink.jl.
Related Issues (20)
- `==` dosen't work for WExpr generated by `@W_cmd` HOT 1
- Including overloading of basic algebra HOT 10
- Bug: Julia Mathlink installation on Windows 10 HOT 4
- TagBot trigger issue HOT 9
- Possibility of allocation-free from julia via MathLink HOT 2
- Problem : UndefVarError: set_texOutput not defined HOT 2
- ParseError: KaTeX parse error HOT 2
- MathLink package can't find file "dep.jl" & fail to precompiling pkg. HOT 5
- Finding paths
- Wishlist from Wolfram HOT 2
- Symbolics to MathLink translation of expressions HOT 4
- Passing arrays to MathLink HOT 2
- Extracting values from arbitrary MathLink.WExpr HOT 8
- MathLink with HypergeometricFunctions HOT 8
- W"List"(0.02) -> 0.02? HOT 1
- precision may be lost HOT 3
- MathLink not working on Julia 1.10? HOT 2
- Wrong path delimiter on Windows
- Mathematica arm64 version needed on M1 MacBook? HOT 8
- W2Julia expects an Expr, not a WExpr. HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mathlink.jl.