Re: [julia-users] Re: Build a constructor with fewer inputs than values

2014-03-27 Thread RecentConvert
It works! Thanks for the help and patience.

Re: [julia-users] Re: Build a constructor with fewer inputs than values

2014-03-27 Thread RecentConvert
Not sure how it's suppose to go. As I understood it from the constructors documentation *new* was how it was done, not return.

Re: [julia-users] Re: Build a constructor with fewer inputs than values

2014-03-27 Thread Tim Holy
On Thursday, March 27, 2014 07:41:34 AM RecentConvert wrote: > Not sure how it's suppose to go. As I understood it from the constructors > documentation > *new* was how it was done, not return. Meaning, the point is that your print("Te

Re: [julia-users] Re: Build a constructor with fewer inputs than values

2014-03-27 Thread Tim Holy
Status isn't returning the value created by new. --Tim On Thursday, March 27, 2014 05:45:08 AM RecentConvert wrote: > It turns out the error wasn't in the code I posted but how it was then > implemented though I still am not sure what is wrong. > > This code works. > type Status AutoBG::Vector{Bo

Re: [julia-users] Re: Build a constructor with fewer inputs than values

2014-03-24 Thread Tim Holy
I get julia> x.Valve1 12-element Array{Bool,1}: true false true false true false true false true false true false I even went to the trouble to build Julia 0.2.1 and test it there, too; same result. So I can't replicate your problem. (I'm on Linux.) How are you getting Julia?

Re: [julia-users] Re: Build a constructor with fewer inputs than values

2014-03-24 Thread RecentConvert
The updated code works the same with Status([1:12]) as it does with vector(Dstc["StatusW"]). type Status Valve1::Vector{Bool} Valve2::Vector{Bool} Valve3::Vector{Bool} Valve4::Vector{Bool} Valve5::Vector{Bool} Valve6::Vector{Bool} Valve7::Vector{Bool} Valve8::Vector{Bool}

Re: [julia-users] Re: Build a constructor with fewer inputs than values

2014-03-24 Thread Tim Holy
On Monday, March 24, 2014 03:56:08 AM RecentConvert wrote: > statuses = Status(vector(Dstc["StatusW"])) That's still not very helpful, because we have no idea what vector(Dstc["StatusW"]) yields. Does Status([1:12]) work? If so, the problem is in the particular inputs you're supplying. If not, t

[julia-users] Re: Build a constructor with fewer inputs than values

2014-03-24 Thread RecentConvert
Thanks for the quick replies. *Purpose:* Given a double, convert it to a collection of boolean values representing the statuses of various valves and settings. I'm still torn about whether I want to input an array of values and store arrays of statuses in one type or create an array of the type

[julia-users] Re: Build a constructor with fewer inputs than values

2014-03-24 Thread Ivar Nesje
Sorry that you did not get any response, I did not comprehend what you were trying to do last time. The code you posted seems to work fine for me on 0.2.1 and 0.3-prerelease. How did you trigger the error? As a side note if efficiency is important, I would recommend that you use Valve2::Array{

Re: [julia-users] Re: Build a constructor with fewer inputs than values

2014-03-24 Thread Tim Holy
On Monday, March 24, 2014 03:02:37 AM RecentConvert wrote: > Is this question not clear or just uninteresting? You're not showing how you're actually calling the constructor. If I copy/paste your type definition, and then say Status([1:12]), it works just fine for me. What version of Julia are

[julia-users] Re: Build a constructor with fewer inputs than values

2014-03-24 Thread RecentConvert
Is this question not clear or just uninteresting?