[julia-users] Re: Warning on operations mixing BigFloat and Float64

2016-04-20 Thread Daan Huybrechs
(this > <https://github.com/JuliaLang/julia/blob/master/base/mpfr.jl#L229> line > for example). I ended up writing a minimal implementation of an > AbstractNumber type, and so far it worked out pretty well. > > W dniu wtorek, 19 kwietnia 2016 15:17:31 UTC+2 użytkownik Daan

[julia-users] Re: Warning on operations mixing BigFloat and Float64

2016-04-19 Thread Daan Huybrechs
I second that - overwriting the conversion worked very well for me while debugging some time ago. If you throw an error, you get the exact line number where it happened: Base.convert(::Type{BigFloat}, x::Float64) = throw(InexactError()) One case to watch out for, which I only found in my code

Re: [julia-users] Memory allocation free array slices ?

2016-02-09 Thread Daan Huybrechs
Wow, this trick to add CartesianRange's (or other isbits-immutable-iterators I guess) without allocation was very good to learn about, thanks a lot! Pending more efficient views, this is very helpful to me as well.

[julia-users] (Yet another) tutorial

2015-11-05 Thread Daan Huybrechs
I have recently given a Julia introduction to a group of numerical analysts at the university of Leuven, Belgium. For this, I have written a set of notebooks, and they are available here: https://github.com/daanhb/Julia-tutorial The goal of the tutorial is not to survey syntax and features of

[julia-users] Re: (Yet another) tutorial

2015-11-05 Thread Daan Huybrechs
he very core of Julia. Thanks again... > > On Thursday, November 5, 2015 at 4:47:10 AM UTC-5, Daan Huybrechs wrote: >> >> I have recently given a Julia introduction to a group of numerical >> analysts at the university of Leuven, Belgium. For this, I have written a >>

[julia-users] Re: (Yet another) tutorial

2015-11-05 Thread Daan Huybrechs
Hi Scott Thanks for your comments. You have a point, and I probably overdid it in the tutorial when I stressed that adding types is only for dispatch. It can also have documentation value and indeed may help to catch errors - nothing wrong with that. I will rephrase it later. The main thing I

[julia-users] Re: Compile time factorial example using staged functions

2015-07-17 Thread Daan Huybrechs
Hi Magnus *macro fac(n)* *:($(factorial(n)))* *end* That will do, yes - many thanks for your message! I don't think I've grasped macros very well before. Actually, I still don't, but one useful thing I've learned at least about generated functions from this and other examples is

Re: [julia-users] julia on arm - some more progress

2015-05-31 Thread Daan Huybrechs
and let LLVM do it's thing? -viral On 29 May 2015 9:27 pm, Daan Huybrechs daan.hu...@gmail.com wrote: On the other hand, building with the LLVM binaries from llvm.org does still work on a Pi 2 to get a working REPL - I just tested that with gcc-4.9 and LLVM 3.6.1 today

[julia-users] Re: julia on arm - some more progress

2015-05-29 Thread Daan Huybrechs
On the other hand, building with the LLVM binaries from llvm.org does still work on a Pi 2 to get a working REPL - I just tested that with gcc-4.9 and LLVM 3.6.1 today. Daan

[julia-users] Re: Parameters of type parameters as field types - is it possible?

2015-04-29 Thread Daan Huybrechs
Hi Robert versions 2 and 3 were the alternatives that I was also looking at. Just seems to be lacking in elegance. Is there anything that the call() syntax can provide? Agreed about elegance, it seems a bit overkill. I'm not sure what you're thinking off with call(). Another

[julia-users] Re: Parameters of type parameters as field types - is it possible?

2015-04-29 Thread Daan Huybrechs
At the risk of being redundant, I would like to say a bit more, because I remember struggling with similar constructions at first - please forgive my lecturing :-) Say you do include T as a parameter for Bar, then there are still several ways to proceed. The following seems to make syntactical

[julia-users] Compile time factorial example using staged functions

2015-04-09 Thread Daan Huybrechs
Trying to grasp staged functions in Julia 0.4, I found the new documentation https://github.com/JuliaLang/julia/pull/10673 and this issue https://github.com/JuliaLang/julia/pull/7474 very helpful. (Note from the issue that the syntax may still change from `stagedfunction` to, perhaps,

Re: [julia-users] A method with an optional parameter may result in a different method being called

2015-04-08 Thread Daan Huybrechs
Thanks, Seth, that example looks even stranger than what I encountered. I have suggested adding a short paragraph to the manual: https://github.com/JuliaLang/julia/pull/10769 I can't think of a case where the author of code would like a default value of a method to be used in another method

[julia-users] A method with an optional parameter may result in a different method being called

2015-04-08 Thread Daan Huybrechs
I was a little surprised today by the following behaviour: julia f(d=2) = d f (generic function with 2 methods) julia f(a::Int) = -a f (generic function with 3 methods) julia f() -2 julia methods(f) # 3 methods for generic function f: f() at none:1 f(a::Int64) at none:1 f(d) at none:1 Yet,

Re: [julia-users] A method with an optional parameter may result in a different method being called

2015-04-08 Thread Daan Huybrechs
On Wednesday, April 8, 2015 at 3:52:44 PM UTC+2, Mauro wrote: On Wed, 2015-04-08 at 15:34, Daan Huybrechs daan.hu...@gmail.com javascript: wrote: I was a little surprised today by the following behaviour: julia f(d=2) = d f (generic function with 2 methods) julia f(a::Int

[julia-users] Re: [ANN] Dierckx.jl: 1-d and 2-d splines as in scipy.interpolate

2014-10-29 Thread Daan Huybrechs
Contributions, or advice on the correct pronunciation of Dierckx, gratefully accepted. The original code was written well before my days in Leuven (and the author retired last year), but I can help with the pronunciation :-) The -ckx is just like x, fortunately. The -ie- is like the i in