El lunes, 20 de abril de 2015, 20:04:25 (UTC+2), Marcus Appelros escribió:
>
> Currently some modifications to REPL.jl are needed, there is a fork 
> made which does exactly that. 
>
> Am trying to test some of the examples in the SJulia readme, keep in 
> mind that this is on a old sourcebuilt 0.4 master. 
>
> ``` 
> julia> m= @ex Expand((a+b)^10) 
> Expand((a + b) ^ 10) 
>
> julia> m[2] 
> ERROR: BoundsError() 
>  in getindex at /home/quin/SJulia/src/mxpr_type.jl:267 
> ``` 
>
> Your example does work for me using  Version 0.4.0-dev+3965 (2015-03-22 
12:24 UTC),
but things break fast with 0.4.0 !
 

> Apparently the only method found is: 
>
> ``` 
> julia> t= @ex (a+b)^10 
> (a + b) ^ 10 
>
> julia> typeof(t) 
> Mxpr{Power} 
>
> julia> tt=SJulia.mxpr(:Expand,t) 
> Expand((a + b) ^ 10) 
>
> julia> ttt=typeof(tt) 
> Mxpr{Expand} 
>
> julia> methods(SJulia.apprules,(ttt,)) 
> 1-element Array{Any,1}: 
>  apprules(x) at /home/quin/SJulia/src/apprules.jl:9 
> ``` 
>
>  
You shouldn't need to do all that. I'll have to build a new v 0.4.0 and see 
if there is a problem.
 

> Which is set to equal x. Also there's this: 
>
> ``` 
> julia> function f(n);@ex Expand((a+b)^n);end 
> f (generic function with 1 method) 
>
> julia> f(3) 
> Expand((a + b) ^ n) 
> ``` 
>
>
Yes, the macro is expanded when it is entered. Julia functions can be used 
with SJulia, but it is not integrated to this extent. I think I do have a 
Julia-side interface to Expand, but it is disabled. I need to find a more 
organized way to make some SJulia functionality available from Julia.

 

> The Fibbonacci example does work. 
>
> On 20 April 2015 at 19:14, Viral Shah <[email protected] <javascript:>> 
> wrote: 
> > Would it be possible to install SJulia as a Julia package, and switch 
> > between SJulia and Julia - kind of like how we have the help> and the 
> shell> 
> > prompts, which can be activated with ? and ; 
> > 
> > -viral 
> > 
> > 
> > On Monday, April 20, 2015 at 5:46:08 PM UTC+5:30, [email protected] 
> > wrote: 
> >> 
> >> Here is SJulia 
> >> 
> >> https://github.com/jlapeyre/SJulia 
> >> 
> >> sjulia> f = (x^y + y^z + z^x)^3 
> >> (x ^ y + y ^ z + z ^ x) ^ 3 
> >> 
> >> sjulia> f = (x^y + y^z)^3 
> >> (x ^ y + y ^ z) ^ 3 
> >> 
> >> sjulia> g = Expand(f) 
> >> x ^ (3 * y) + 3 * (x ^ (2 * y)) * (y ^ z) + 3 * (x ^ y) * (y ^ (2 * z)) 
> + 
> >> y ^ (3 * z) 
> >> 
> >> SJulia is very close in spirit to Mathematica (Wolfram). This is more 
> or 
> >> less a language written in Julia, 
> >> although it can be made to communicate well with Julia. From the user's 
> >> perspective, there are advantages and disadvantages to 
> >> implementing symbolic capability as an extension to languages like 
> Julia 
> >> or Python rather than as 
> >> another language. I think it is possible to have a language that 
> supports 
> >> both. 
> >> 
> >> Also, CAS can describe various software tools that are designed to do 
> very 
> >> different things. For instance, a CAS may  be intended to implement 
> more or 
> >> less mathematical rigor. It may have a hierarchy of computer language 
> types 
> >> meant to represent mathematical objects. Or 
> >> it may (like Mathematica, Maple, and Maxima) be based on 'expressions' 
> >> that are essentially devoid of meaning. All of these distinctions, 
> >> particularly the latter, regarding purpose, are typically confused in 
> >> discussions on internet fora. 
> >> 
> >> I think that Julia is a great language for symbolic computation. Have 
> fun! 
> >> --John 
> >> 
> >> 
> >> On Sunday, April 19, 2015 at 7:47:34 PM UTC+2, Marcus Appelros wrote: 
> >>> 
> >>> Hi Kevin, thanks for the link! From the end of that thread: 
> >>> 
> >>> "Has anybody written pure Julia symbolic math for things like: 
> >>> 
> >>> f = (x**y + y**z + z**x)**100 
> >>> g = f.expand()" 
> >>> 
> >>> "As far as I know there is no Julia package which supports such 
> symbolic 
> >>> expressions and manipulation." 
> >>> 
> >>> Now there is! 
> >>> 
> >>> Saw a more recent dev discussion calling for someone to write a 
> package 
> >>> like this. Have looked through the package list many times and never 
> found 
> >>> anything that appeared alike the vision of Equations, SymPy has some 
> common 
> >>> functionality however certainly didn't start developing in Julia to 
> use 
> >>> Python. 
> >>> 
> >>> Developing this code is indeed very enjoying and as more of the 
> planned 
> >>> features become released a solid user base will be established, have 
> >>> expanded the todolist with an impelling to read the discussion in your 
> link 
> >>> so as to hasten the construction of such a foundation, as per your 
> >>> recommendation. 
> >>> 
> >>> With love. <3 
>

Reply via email to