julia> begin
@show vara = 33
@show varb = vara * 14
@show varc = varb * 77
end
vara = 33 = 33
varb = vara * 14 = 462
varc = varb * 77 = 35574
35574
On Sun, Jan 4, 2015 at 5:47 AM, Mike Innes <[email protected]> wrote:
> Have you met @show?
> - mostrar texto citado -
>
yo (Ismael VC cambiar)
10:22 (hace 3 minutos)
Re: [julia-users] Re: Debug printing a “value” and its “symbol”
Traducir el mensaje al español
Reading the code, there is also a `indent` option, i thought it accepted a
boolean, but not, I find it very unintuitive:
dump(io::IO, x, n::Int, indent) = xdump(dump, io, x, n, indent)
julia> dump(:(1 + 1 * 3 - 4^7), 10, false)
Expr
false head: Symbol call
false args: Array(Any,(3,))
false 1: Symbol -
false 2: Expr
false head: Symbol call
false args: Array(Any,(3,))
false 1: Symbol +
false 2: Int32 1
false 3: Expr
false head: Symbol call
false args: Array(Any,(3,))
false 1: Symbol *
false 2: Int32 1
false 3: Int32 3
false typ: Any
false typ: Any
false 3: Expr
false head: Symbol call
false args: Array(Any,(3,))
false 1: Symbol ^
false 2: Int32 4
false 3: Int32 7
false typ: Any
false typ: Any
And once can't use this argument, as a keyword argument:
julia> dump(:(1 + 1 * 3 - 4^7), indent="--->")
ERROR: function dump does not accept keyword arguments
Keyword arguments are slow? Or why are the not used that much throughout
the API?
El domingo, 4 de enero de 2015 09:46:21 UTC-6, Ismael VC escribió:
>
> That's not documented:
>
> help?> dump
> Base.dump(x)
>
> Show all user-visible structure of a value.
>
> Are there any more options to dump?
>
> On Sun, Jan 4, 2015 at 5:10 AM, <[email protected]> wrote:
>
>> Not sure, but maybe this is what you are looking for,
>>
>> https://gist.github.com/toivoh/4121122
>>
>>
>> On Sunday, January 4, 2015 6:49:39 AM UTC+1, Darwin Darakananda wrote:
>>>
>>> Hi everyone,
>>>
>>> Is there currently a function that converts s-expressions into Expr
>>> structures (basically the reverse of Base.Meta.show_sexpr)?
>>>
>>> I just started playing around with metaprogramming in Julia, so I'm
>>> probably doing things wrong. But there are a lot of times where I end up
>>> creating highly nested Expr objects, ending up with code that is
>>> indecipherable. I've found that the output from show_sexpr is sometimes
>>> easier to read that that of dump or xdump (which only seems to display the
>>> first couple of levels). So I'm curious to see if the reverse
>>> (s-expression -> Expr) is also true.
>>>
>>> If this function does not exist, would it be something that people would
>>> find useful?
>>>
>>> Thanks and Happy New Years!
>>>
>>> Darwin
>>>
>>
>