This is a neat solution, thanks! But I still think that there is a
corner case for which there is no syntax, so I filed #15758.
Best,
Tamas
On Mon, Apr 04 2016, via julia-users wrote:
> I saw your repost on julia-dev, but replying here.
>
> m2 won't work because it expects a series of tuple arg
I saw your repost on julia-dev, but replying here.
m2 won't work because it expects a series of tuple arguments (which if
supplied would slurp up into a tuple of tuples).
m3 seems the way to go.
I wouldn't necessarily look at it as indirect however.
Think of it as one function with 2 methods:
Hi Bill,
It works for a single argument, but not for multiple ones. I have a
self-contained example:
--8<---cut here---start->8---
module Foos
type Foo{T <: Tuple}
end
m1{T}(f::Foo{Tuple{T}}, index::T...) = 42 # suggested by Bill Hart
m2{T}(f::Foo{T}, inde
The following seems to work, but I'm not sure whether it was what you
wanted:
import Base.getindex
type Foo{T <: Tuple}
end
getindex{T}(f::Foo{Tuple{T}}, index::T...) = 42
Foo{Tuple{Int}}()[9]
Bill.
On Wednesday, 23 March 2016 14:38:20 UTC+1, Tamas Papp wrote:
>
> Hi,
>
> My understandin