Your errors are with the typo in Furniture (which leads to ERROR:
UndefVarError: Furniture not defined) and the parentheses around your type
parameterization here:
julia f({T : Furnature})(::Type{T}) = 10
The correct function definition should be
julia f{T : Furniture}(::Type{T}) = 10
On
(of course .. ) thank you
On Monday, August 3, 2015 at 7:49:11 PM UTC-4, Seth wrote:
Your errors are with the typo in Furniture (which leads to ERROR:
UndefVarError: Furniture not defined) and the parentheses around your type
parameterization here:
julia f({T : Furnature})(::Type{T}) = 10
would you mind updating this, I just ran it and did not know how to
change {T : Furnature} to Use Any[a,b, ..] instead, thank you
julia abstract Furnature
julia type Table : Furnature
end
julia f({T : Furnature})(::Type{T}) = 10
WARNING: deprecated syntax {a,b, ...}.
Use Any[a,b,
Is this what you're looking for?
julia abstract Furniture
julia type Table : Furniture end
julia f{T:Furniture}(::Type{T}) = 10
f (generic function with 1 method)
julia f(Furniture)
10
julia f(Table)
10
On Thursday, July 23, 2015 at 9:34:12 AM UTC-7, Vinuth Madinur wrote:
Hi,
Is there
Yes!
Thats awesome.
Thanks,
Vinuth.
On Thursday, July 23, 2015 at 10:10:04 PM UTC+5:30, Seth wrote:
Is this what you're looking for?
julia abstract Furniture
julia type Table : Furniture end
julia f{T:Furniture}(::Type{T}) = 10
f (generic function with 1 method)
julia f(Furniture)
And to be complete, depending on your use-case:
julia abstract Furniture
julia type Table : Furniture end
julia f(::Furniture) = 10
f (generic function with 1 method)
julia f(Table())
10
On Thursday, July 23, 2015 at 1:01:39 PM UTC-4, Vinuth Madinur wrote:
Yes!
Thats awesome.
Thanks,