Tuple project method

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Tuple project method

Flavio Pompermaier
Hi flinkers,

it happens very often to me that I have to output a reuse tuple that
basically is a subset of the data contained of the input tuple..do you
think it could be useful to add a project method to Tuple class?

So that to be able to write something like:

Tuple3<x,x,x> reuse = tuple.project(0,2,5)?

Best,
Flavio
Reply | Threaded
Open this post in threaded view
|

Re: Tuple project method

Flavio Pompermaier
Sorry, to be effective the project should also take in input the target
tuple itself :)

Tuple3<x,x,x> reuse = tuple.project(reuse, 0,2,5)?

On Wed, May 27, 2015 at 11:51 AM, Flavio Pompermaier <[hidden email]>
wrote:

> Hi flinkers,
>
> it happens very often to me that I have to output a reuse tuple that
> basically is a subset of the data contained of the input tuple..do you
> think it could be useful to add a project method to Tuple class?
>
> So that to be able to write something like:
>
> Tuple3<x,x,x> reuse = tuple.project(0,2,5)?
>
> Best,
> Flavio
>
Reply | Threaded
Open this post in threaded view
|

Re: Tuple project method

Stephan Ewen
It would be an interesting addition.

Such a method cannot be done fully type safe in Java, but that might be
okay, since it is user-code internal.

On Wed, May 27, 2015 at 11:52 AM, Flavio Pompermaier <[hidden email]>
wrote:

> Sorry, to be effective the project should also take in input the target
> tuple itself :)
>
> Tuple3<x,x,x> reuse = tuple.project(reuse, 0,2,5)?
>
> On Wed, May 27, 2015 at 11:51 AM, Flavio Pompermaier <[hidden email]
> >
> wrote:
>
> > Hi flinkers,
> >
> > it happens very often to me that I have to output a reuse tuple that
> > basically is a subset of the data contained of the input tuple..do you
> > think it could be useful to add a project method to Tuple class?
> >
> > So that to be able to write something like:
> >
> > Tuple3<x,x,x> reuse = tuple.project(0,2,5)?
> >
> > Best,
> > Flavio
> >
>