Re: [julia-users] What makes a programming language successful?

2015-08-21 Thread Erik Schnetter
So Robert Griesemer's points (features important for a new language to be successful) are: 1. clear target 2. solid implementation: language, libraries, and tools 3. market readiness 4. technological breakthrough 5. language features without competitors I think Julia has all of 1 to 4. If I

Re: [julia-users] throw vs error

2015-08-21 Thread Michele Zaffalon
Verbosity aside, (which may also be disputable since errors are supposed to be rare...), I still do not see the difference even from reading the constructed examples in the manual: both are examples of functions that are not defined for negative arguments, but in the first case, the function

[julia-users] Defining composite types with fields that include each other

2015-08-21 Thread Paul Thompson
Hi: I want to define two types, and each will have a field that is the other type. For instance: type Foo bar::Bar otherfield1 otherfield2 end type Bar foo::Foo otherfield1 otherfield2 end The above results in an error when defining Foo because Bar is not defined. I could make the types

[julia-users] How to use multiplication or operation of three dimensional matrix, when change R code to Julia code? It is always error.

2015-08-21 Thread meibujun
R code below changed to Julia code. It is always error. I do not know how to change R code below to Julia code correctly? Thank you. #R code forward - function(G.I,Tr,Pr) { n.samp - dim(G.I)[1] n.mark - dim(G.I)[2] F - G.I F[,1,] - sweep(G.I[,1,],2,Pr,*) for (i in 2:n.mark)

[julia-users] Weird error in @everywhere begin...end block

2015-08-21 Thread Nils Gudat
I'm reading in an h5 file using the HDF5 package and need to invert it over the first two dimensions after reading it in, and I'm doing so in a @everywhere begin...end block, as the data has to be available on all workers. For some reason, doing both steps within one block fails. This works as

[julia-users] Definition of equality

2015-08-21 Thread Dawid Crivelli
How do you define the `==` operator for a new type? If I try and define the `isequal` operator, that definition does not apply to '==': import Base.isequal type inty insideint :: Int end isequal(a :: inty, b :: Int) = a.insideint == b inty(5) == 5# false on Julia Version

Re: [julia-users] Re: Definition of equality

2015-08-21 Thread Stefan Karpinski
These days you generally want to overload == rather than isequal. On Fri, Aug 21, 2015 at 9:24 AM, Sisyphuss zhengwend...@gmail.com wrote: They are two different operators. import Base.== type inty insideint :: Int end ==(a :: inty, b :: Int) = a.insideint == b inty(5) == 5 On

Re: [julia-users] ode-sundials-events option as in deSolve (R)

2015-08-21 Thread Tom Short
One way is with the Sims package. I'm not sure I got everything right with your model. https://tshort.github.io/Sims.jl/ using Sims, Winston function model() # note that the time scale is in hours D = Unknown(10.0, D) A1 = Unknown(A1) rateConstant1 = 3.0 rateConstant2 = 5.0

[julia-users] Re: Weird error in @everywhere begin...end block

2015-08-21 Thread Nils Gudat
NB: I just saw a post on the Juno forum http://discuss.junolab.org/t/compile-error-when-using-statement-and-for-loop-are-inside-begin-block/295 about this, so it might just be a Juno issue.

Re: [julia-users] Constructor or convert(), Upper case or lower case

2015-08-21 Thread Scott Jones
Yes, but I think that window will rapidly be shutting for Julia. It is becoming a victim of it's own success, so many people are seeing the advantages of Julia, even now, while there are still a few warts (which hopefully will get addressed quickly during ArrayMegeddon in 0.5). This has

[julia-users] Re: Definition of equality

2015-08-21 Thread Sisyphuss
They are two different operators. import Base.== type inty insideint :: Int end ==(a :: inty, b :: Int) = a.insideint == b inty(5) == 5 On Friday, August 21, 2015 at 3:10:01 PM UTC+2, Dawid Crivelli wrote: How do you define the `==` operator for a new type? If I try and define the

Re: [julia-users] throw vs error

2015-08-21 Thread Michele Zaffalon
That is my point: error is the same as throw(ErrorException). Should both co-exist? Is error just a short name for the throw(ErrorException) version? On Fri, Aug 21, 2015 at 5:43 PM, Isaiah Norton isaiah.nor...@gmail.com wrote: `error` is generic, whereas `throw` can raise typed errors, such as

[julia-users] throw vs error

2015-08-21 Thread Michele Zaffalon
In what cases should one use error() instead of throw()? The manual http://docs.julialang.org/en/latest/manual/control-flow/?highlight=error#the-throw-function is not particular clear about the difference: The error() function is used to produce an ErrorException that interrupts the normal

Re: [julia-users] throw vs error

2015-08-21 Thread Isaiah Norton
`error` is generic, whereas `throw` can raise typed errors, such as DomainError, SimdError, UVError, etc. which may have special handling -- for example, customized `show` methods to print help/suggestions to resolve the specific situation. (see also the examples here:

Re: [julia-users] throw vs error

2015-08-21 Thread Isaiah Norton
Yes. On Fri, Aug 21, 2015 at 11:51 AM, Michele Zaffalon michele.zaffa...@gmail.com wrote: That is my point: error is the same as throw(ErrorException). Should both co-exist? Is error just a short name for the throw(ErrorException) version? On Fri, Aug 21, 2015 at 5:43 PM, Isaiah Norton

Re: [julia-users] throw vs error

2015-08-21 Thread Stefan Karpinski
This is actually an old debate between me and Jeff. The distinction I tried to make was that `throw` should be used with catch as a form of control flow, while `error` should be used when there's an actual error. However, that distinction hasn't stuck, possibly because he never liked it and it's

Re: [julia-users] Re: Definition of equality

2015-08-21 Thread Erik Schnetter
You want to overload `==`, which automatically defines `isequal`. You may also want to overlad `isless`, which then automatically defines ``, ``, `=`, `=`. -erik On Fri, Aug 21, 2015 at 9:43 AM, Stefan Karpinski ste...@karpinski.org wrote: These days you generally want to overload == rather

[julia-users] #newbie - Bounds error

2015-08-21 Thread Tj Midkiff
I am trying to write a small script to help my company out. I came across Julia on a web search naturally when looking for more speed. I am just getting my feet wet with programming so please be patient with me. This is one piece of the code that I know is very inefficient, so any help is

[julia-users] Re: #newbie - Bounds error

2015-08-21 Thread Tj Midkiff
Ok I got the bounds error figure out. I would still appreciate any feedback you might have. On Friday, August 21, 2015 at 3:37:48 PM UTC-5, Tj Midkiff wrote: I am trying to write a small script to help my company out. I came across Julia on a web search naturally when looking for more

Re: [julia-users] Constructor or convert(), Upper case or lower case

2015-08-21 Thread Jeffrey Sarnoff
+1 respellings and renamings that follow from this thread If you know, please provide us with those words/names/symbols in v0.4 today that have capitalizations, spellings, or patternings that are inconsistent with the way very similar role/intent/use/purpose is expressed in better reviewed,

Re: [julia-users] Trouble compiling Julia v0.4

2015-08-21 Thread Elliot Saba
You shouldn't need libiconv installed through Homebrew for Julia, I don't think. Unlink libiconv, delete deps/libgit2 and reinstall. Usually when brew doesn't want to link something, it's for a good reason. -E

[julia-users] Re: #newbie - Bounds error

2015-08-21 Thread Jeffrey Sarnoff
you created R to hold 600 things, things indexable as R[1]..R[600] mnths=600 R=zeros(Float64,mnths) later you bring Julia's attention to R[600+1], just one step 'out of bounds' when i is 600, i+1 is 601 In Julia, the top part of the range is included That loop should be for i in 3:(600-1)

Re: [julia-users] Constructor or convert(), Upper case or lower case

2015-08-21 Thread Jeffrey Sarnoff
any chance putting in 'Symbol' with a preferred use warning to (depr..) 'symbol'? On Thursday, August 20, 2015 at 11:21:41 AM UTC-4, Stefan Karpinski wrote: Yes. In old languages, there's no longer any hope of fixing the inconsistencies. On Thursday, August 20, 2015, Sisyphuss

[julia-users] Re: #newbie - Bounds error

2015-08-21 Thread Tj Midkiff
Thank you Jeff. On Friday, August 21, 2015 at 3:51:41 PM UTC-5, Jeffrey Sarnoff wrote: you created R to hold 600 things, things indexable as R[1]..R[600] mnths=600 R=zeros(Float64,mnths) later you bring Julia's attention to R[600+1], just one step 'out of bounds' when i is 600, i+1 is

Re: [julia-users] Trouble compiling Julia v0.4

2015-08-21 Thread Jameson Nash
homebrew will generally refuse to install libiconv, since forcing homebrew to install could cause significant issues with other compiles on your machine (like julia) if you've installed homebrew in their recommended location of /usr/local. I recommend uninstalling that and deleting the

[julia-users] Loading a module in Julia v0.4

2015-08-21 Thread Sayeed Tasnim
I tried searching around the group and I couldn't really find what I was looking for. I'm running the following Julia version on Windows: Julia Version 0.4.0-dev+6859 Commit 92ddae7 (2015-08-20 19:38 UTC) Platform Info: System: Windows (x86_64-w64-mingw32) CPU: Intel(R) Core(TM) i5-4300U CPU

[julia-users] Re: Splitting a multidimensional function

2015-08-21 Thread David P. Sanders
Here is a fun and possibly useful solution (that works only on 0.4 due to call overloading): https://gist.github.com/dpsanders/d8ef239ec8c78c4debee It introduces a `MultidimFunction` type, and a macro `@multidim` that works as follows: julia @multidim f(x) = [sqrt(x[1]), 2x[2]]

[julia-users] Re: #newbie - Bounds error

2015-08-21 Thread Jeffrey Sarnoff
You are welcome, please call me Jeffrey. I can give you a few first impressions. Usespace,itfreesyouandinformsme: == Use space, it frees you and informs me: R[1]=mOil[2]/(mOil[2]-mOil[1])+b == R[1] = mOil[2]/(mOil[2] - mOil[1]) + b Time wells in loops, any savings inside a 600x

[julia-users] Difference between ascii(foobar) and simply foobar?

2015-08-21 Thread Scott Jones
I noticed 3 lines had been changed in the test files I was working on, and it didn't make any sense to me. I thought that ascii(literalstring) where literal string only had ASCII characters, and was already ASCIIString type, would be a no-op, but somebody who I think should know made the change,