Re: [julia-users] Re: Why does this dispatch occur? (parametric types)

2014-07-04 Thread Andrew McKinlay
to figure out. Maybe someone should do a PhD thesis on it. Someone other than me should answer When would I want to use one definition over the other? On Thursday, July 3, 2014 3:16:41 PM UTC-4, Andrew McKinlay wrote: Why does foo{T:Number}(x::T) = 1 foo(x::Number) = 2 println(foo(3

[julia-users] Macros versus expression objects

2014-06-21 Thread Andrew McKinlay
What's the difference between writing macros versus functions that take `Expr` objects? Is there anything you can't do with a function that takes expression objects? Are there any advantages of using macros beyond no having to quote the code you pass as an argument?

Re: [julia-users] Macros versus expression objects

2014-06-21 Thread Andrew McKinlay
What can I do at compile-time that I can't at run-time? On Jun 21, 2014 2:49 PM, Jameson Nash vtjn...@gmail.com wrote: A macro inserts the result back into the AST. and it is called at compile-time, not run-time. On Saturday, June 21, 2014, Andrew McKinlay mckinlay.and...@gmail.com wrote

[julia-users] Why do you need to declare const here?

2014-06-20 Thread Andrew McKinlay
In the process of playing with Julia I ran into an interesting situation I demonstrated in this bug: https://github.com/JuliaLang/julia/issues/7320. As I asked in the issue but which I should probably ask here, why does declaring `foo` to be `const` solve this issue? ... Okay, nevermind. It

[julia-users] Metaprogramming weirdness

2014-05-22 Thread Andrew McKinlay
I have been trying to grok Julia macros, so I've dived into the metaprogramming docs. Whilst playing around with the interpreter, I've run into some peculiarities that I don't quite understand. julia versioninfo() Julia Version 0.3.0-prerelease+2690 Commit e4c2f68* (2014-04-20 12:15 UTC) ...