Re: [julia-users] How to print out the expression of a simple function

2016-04-26 Thread Yichao Yu
On Wed, Apr 27, 2016 at 12:08 AM, Ismael Venegas Castelló < ismael.vc1...@gmail.com> wrote: > Does the field code has a use for non anon funcs? I can see that the > g.code object is a LambdaStaticData, so only for anon funcs. I was trying > to understand the implementation differences. > Not

Re: [julia-users] How to print out the expression of a simple function

2016-04-26 Thread Ismael Venegas Castelló
Does the field code has a use for non anon funcs? I can see that the g.code object is a LambdaStaticData, so only for anon funcs. I was trying to understand the implementation differences. ​ Ismael Venegas Castelló *Data Analyst* Cel. 044 55 6434 0229 ivene...@richit.com.mx Cerro San

Re: [julia-users] How to print out the expression of a simple function

2016-04-26 Thread Yichao Yu
On Tue, Apr 26, 2016 at 10:42 PM, Ismael Venegas Castelló wrote: > Why is `f.code` an `UndefRefError`? > > julia> f.code > > ERROR: UndefRefError: access to undefined reference > Because it doesn't exist. > > > El martes, 26 de abril de 2016, 18:27:50 (UTC-5), Yichao Yu

Re: [julia-users] How to print out the expression of a simple function

2016-04-26 Thread Ismael Venegas Castelló
This works with anonymous functions though: julia> g = (x) -> x.^2 (anonymous function) julia> g.code AST(:($(Expr(:lambda, Any[:(x::Any)], Any[Any[Any[:x,:Any,0]],Any[],0,Any []], :(begin # none, line 1: return x .^ 2 end) El martes, 26 de abril de 2016, 21:42:29 (UTC-5),

Re: [julia-users] How to print out the expression of a simple function

2016-04-26 Thread Ismael Venegas Castelló
Why is `f.code` an `UndefRefError`? julia> f.code ERROR: UndefRefError: access to undefined reference El martes, 26 de abril de 2016, 18:27:50 (UTC-5), Yichao Yu escribió: > > On Tue, Apr 26, 2016 at 6:39 PM, > wrote: > > I wonder how to print the expression of a

Re: [julia-users] How to print out the expression of a simple function

2016-04-26 Thread Yichao Yu
On Tue, Apr 26, 2016 at 6:39 PM, wrote: > I wonder how to print the expression of a function, e.g. x.^2 for the > following example. > > julia> f(x) = x.^2 > f (generic function with 1 method) > > julia> f > f (generic function with 1 method) > > If it is not possible for

[julia-users] How to print out the expression of a simple function

2016-04-26 Thread chobbes158
I wonder how to print the expression of a function, e.g. x.^2 for the following example. julia> f(x) = x.^2 f (generic function with 1 method) julia> f f (generic function with 1 method) If it is not possible for the expression of a function as simple as the above to be printed, is there a