Re: [julia-users] Re: Manually defining default constructor for Parametric type

2014-04-22 Thread Stefan Karpinski
This is by far one of the more confusing parts of core Julia syntax. I apologize for not having come up with anything clearer :-\ On Tue, Apr 22, 2014 at 10:36 AM, Jameson Nash wrote: > Even more confusing, you can define a parametric inner constructor: > Point{S}(x::S, y::S) = ..., which defin

Re: [julia-users] Re: Manually defining default constructor for Parametric type

2014-04-22 Thread Jameson Nash
Even more confusing, you can define a parametric inner constructor: Point{S}(x::S, y::S) = ..., which defines methods for Point{T} On Tue, Apr 22, 2014 at 10:31 AM, Matt Bauman wrote: > On Tuesday, April 22, 2014 12:08:01 AM UTC-4, Kevin Squire wrote: >> >> … until I realized that T in the first

Re: [julia-users] Re: Manually defining default constructor for Parametric type

2014-04-22 Thread Matt Bauman
On Tuesday, April 22, 2014 12:08:01 AM UTC-4, Kevin Squire wrote: > … until I realized that T in the first set of braces is a function type > parameter (i.e., specializing the function), and the second is a > specialization of the constructed type. > Yes, exactly. I think it's that the notatio

Re: [julia-users] Re: Manually defining default constructor for Parametric type

2014-04-21 Thread Kevin Squire
Slightly ancillary, but perhaps relevant: the part that I struggled with around this notation was understanding/remembering that 1) outer constructors are just normal functions 2) for parametric types, defining any inner constructor means there's no default constructor 3) when there's no default c

[julia-users] Re: Manually defining default constructor for Parametric type

2014-04-21 Thread Spencer Lyon
Matt, that is exactly what I was missing. I can't believe I missed that section of the docs. Thanks! On Monday, April 21, 2014 4:25:51 PM UTC-4, Matt Bauman wrote: > > I remember getting caught on this, as well. I think I had to read the > section on Parametric > Constructors

[julia-users] Re: Manually defining default constructor for Parametric type

2014-04-21 Thread Matt Bauman
I remember getting caught on this, as well. I think I had to read the section on Parametric Constructors in the docs about 5 times before finally understanding it. Basically, the implicit constructor is the sam