Re: [julia-users] How come (x, y) isn't legal syntax?

2014-09-09 Thread gentlebeldin
Not true, is an undocumented singular case (regrettably). - is a unary operator, too, but nonetheless, -(1,5) gives -4, as it well should. Am Dienstag, 9. September 2014 00:41:01 UTC+2 schrieb Jake Bolewski: Anyt unary operator defined as a `syntatic_unary_operator`

[julia-users] Re: Announcing Julia 0.3.0 final

2014-08-25 Thread gentlebeldin
I've installed Julia via Ubuntu Software-Center, so it installed v0.2.1, months ago. To switch to v0.3, do I have to remove that installation and install the new version with the (Linux) package manager, or is there a gentler way? Probably, there isn't, and what will happen to IJulia etc.? I

Re: [julia-users] Re: Announcing Julia 0.3.0 final

2014-08-25 Thread gentlebeldin
Works like a charm, thanks! Am Montag, 25. August 2014 21:24:44 UTC+2 schrieb Elliot Saba: If you add the official Ubuntu releases PPA, it will automatically pick up Julia 0.3 as a normal software update. Your packages will likely need to be reinstalled since major versions of julia

[julia-users] Re: function version of

2014-08-21 Thread gentlebeldin
Whatever, if I rtfm, especially the part saying Operators Are Functions (with the only exceptions of and ||, because of short-circuit evaluation), then I conclude that the error message following (x,y) is not a feature, it's a bug. And whether we like a generated parser or not, it's better

Re: [julia-users] function version of

2014-08-20 Thread gentlebeldin
Maybe there *are* drawbacks of ad-hoc parsers, after all. I don't want to be offensive, really, I like Julia... but the absence of a formal specification of the grammar is nothing to be proud of. Am Dienstag, 19. August 2014 01:39:53 UTC+2 schrieb Stefan Karpinski: That seems likely. On Aug

Re: [julia-users] About conversion of a 5-decimal-digit float to string

2014-08-13 Thread gentlebeldin
That (after correcting the typo, the missing ) would give cons_0.10. The right way would be charvar = @sprintf(cons_%.5f, 0.1) Am Mittwoch, 13. August 2014 13:48:40 UTC+2 schrieb Andreas Noack: One solution is to use the @sprintf macro, i.e. something like @sprintf(cons_%f,

Re: [julia-users] essay on the history of programming languages

2014-07-19 Thread gentlebeldin
Hmmm, tastes are different, I guess. I love Haskell for its purity and logic, but I've been wary of syntactically meaningful whitespace (aka tabs) since the times of make. :D

Re: [julia-users] Re: Sorting surprises

2014-07-06 Thread gentlebeldin
... On Saturday, July 5, 2014 3:11:47 AM UTC-4, gentlebeldin wrote: It's hard to tell for sure, I wouldn't know how to check that. I prefer to port a few more solutions. My curiosity was much increased by this one: julia include(julia/jl/e443gcd.jl) elapsed time: 3.255950529 seconds (929628 bytes

[julia-users] Re: Dispatch confusion

2014-07-06 Thread gentlebeldin
That's very strange, Julia should know your code is wrong, and it may tell you so, *if* you ask the right question: julia code_typed(bar(b, wat)) ERROR: no method bar(B,ASCIIString) Am Sonntag, 6. Juli 2014 13:33:54 UTC+2 schrieb Magnus Lie Hetland: I just came across a (to me,

[julia-users] Re: specialized functions for unknown types

2014-07-06 Thread gentlebeldin
# don't neccessarily need to be of the same type, but which type to return if not the same? Wouldn't something like promote(typeof(a), typeof(b)) be in the spirit of Julia?

[julia-users] Re: specialized functions for unknown types

2014-07-06 Thread gentlebeldin
One might rather choose for example the type of the first parameter, making + non associative. Hmm, I'd leave such abominations to the creators of Java, who managed to forbid operator overloading for simple folks just because they got it horribly wrong with + for (String, anything), making +

Re: [julia-users] Re: Sorting surprises

2014-07-05 Thread gentlebeldin
It's hard to tell for sure, I wouldn't know how to check that. I prefer to port a few more solutions. My curiosity was much increased by this one: julia include(julia/jl/e443gcd.jl) elapsed time: 3.255950529 seconds (929628 bytes allocated) The Java original runs much longer, 33 seconds. Am

Re: [julia-users] Re: Sorting surprises

2014-07-04 Thread gentlebeldin
I guess you mean something like this: julia using Base.Order julia import Base.lt julia type MyNewOrdering:Ordering end julia f(x::Float64)=x f (generic function with 1 method) julia lt(o::MyNewOrdering,x::Float64,y::Float64)=f(x)f(y) lt (generic function with 9 methods) julia

Re: [julia-users] Re: Sorting surprises

2014-07-04 Thread gentlebeldin
as arguments more efficient. On Fri, Jul 4, 2014 at 5:36 AM, gentlebeldin gentle...@hotmail.com javascript: wrote: I guess you mean something like this: julia using Base.Order julia import Base.lt julia type MyNewOrdering:Ordering end julia f(x::Float64)=x f (generic function with 1

Re: [julia-users] Re: Sorting surprises

2014-07-04 Thread gentlebeldin
, then it's not nearly so neat and tidy. On Fri, Jul 4, 2014 at 9:51 AM, gentlebeldin gentle...@hotmail.com javascript: wrote: Unfortunately, my happiness was a bit premature. With a simple function like f(x)=x or f(x)=sin(x), it works, that's inlined, as it seems. If the function

[julia-users] Sorting surprises

2014-07-03 Thread gentlebeldin
I'm porting some of my programs (solutions of Project Euler problems, btw) from Java to Julia, to check claims concerning performance. Don't you worry, no spoilers, here. But there is a solution where I needed sorting. As long that's sorting by natural order, that seems to work ok, and the

Re: [julia-users] Ann: TaylorSeries.jl v0.0.1

2014-06-29 Thread gentlebeldin
You're right, my code seems to be fast, because it didn't calculate (almost) anything, yet. When you calculate s2[10][10][10][10], it calculates only what it needs for that, meaning the coefficients with i,j,k,l=10. That's not nearly half of them, it's about 1/256, so my code is in reality

Re: [julia-users] Ann: TaylorSeries.jl v0.0.1

2014-06-26 Thread gentlebeldin
, because it is closer to the maths. So, my question is: can we mix our approaches to get the best of both? For the mean time, I'll be playing with your N-d version... Cheers, Luis On Jun 25, 2014, at 2:40 AM, gentlebeldin gentle...@hotmail.com javascript: wrote: Well, I managed

Re: [julia-users] Ann: TaylorSeries.jl v0.0.1

2014-06-25 Thread gentlebeldin
. Am Samstag, 21. Juni 2014 10:13:26 UTC+2 schrieb gentlebeldin: I should generalise the idea to make Taylor parametric, allowing arbitrary types as coefficients (well, almost: they'd have to support the usual mathematical functions). Since that would include Taylor, I'd have multidimensional

Re: [julia-users] Ann: TaylorSeries.jl v0.0.1

2014-06-21 Thread gentlebeldin
without fixing constants before hand. This could make life much simpler for our many-variable implementation... Best, Luis On Jun 20, 2014, at 4:28 PM, gentlebeldin gentle...@hotmail.com javascript: wrote: Hi, I'm glad you like the approach. The simplicity comes from the math

[julia-users] Re: uncurried functions are ok... if you know what you are doing

2014-06-20 Thread gentlebeldin
relevant here: Allow tuple destructuring in formal arguments, https://github.com/JuliaLang/julia/issues/6614 It's a common use case that I run into often, especially with enumerate and dictionaries. So you're not alone. On Thursday, June 19, 2014 3:57:33 AM UTC-4, gentlebeldin wrote: Ah, I see

[julia-users] Re: Ann: TaylorSeries.jl v0.0.1

2014-06-19 Thread gentlebeldin
Sure, I can attach the source, though it's not really something usable, it's rather a proof of concept. I have onle series with Float64 as coefficients, though other number types might be interesting. The data structure is lazy, because it computes data only when asked. I implemented getindex,

[julia-users] uncurried functions are ok... if you know what you are doing

2014-06-18 Thread gentlebeldin
When you come across Julia, and know (a bit of) Haskell, comparisons are inevitable. Haskell has only functions with one argument, but the function value may be another function. It takes some time to wrap your brain around that idea, but hey, it works. Another type of functions with just one