# Reducing redundant typing when returning named tuples

**URL:** <https://discourse.julialang.org/t/reducing-redundant-typing-when-returning-named-tuples/29054>\
**Category:** General Usage\
**Created:** [September 23, 2019, 1:14am UTC](https://discourse.julialang.org/t/reducing-redundant-typing-when-returning-named-tuples/29054 "2019-09-23T01:14:19Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![tbeason](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tbeason/32/15898_2.png) [@tbeason](https://discourse.julialang.org/u/tbeason)\
**Post date:** [September 23, 2019, 1:14am UTC](https://discourse.julialang.org/t/reducing-redundant-typing-when-returning-named-tuples/29054/1 "2019-09-23T01:14:19Z")

</div>

I think there was a post about this a while back but I’m not sure if it was before named tuples were in base or not and I also cannot find it.

Say I create local variables `a`, `b`, and `c` inside a function. I want to return a named tuple `(a=a,b=b,c=c)`. But I do this a LOT and I have more meaningful variable names, so this gets lengthy because I have to type everything TWICE (😭) . Is there a macro sitting around somewhere that will take this variable list and create what I want? Something like `mytuple = @NT a b c` perhaps (I know `@NT` was already used for something else)

It needs to be dynamic because this is basically how I’ve started writing most of my functions…even if that is a bad design decision.

---

<div class="post-metadata">

**Author:** ![tbeason](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tbeason/32/15898_2.png) [@tbeason](https://discourse.julialang.org/u/tbeason)\
**Post date:** [September 23, 2019, 1:18am UTC](https://discourse.julialang.org/t/reducing-redundant-typing-when-returning-named-tuples/29054/2 "2019-09-23T01:18:40Z")

</div>

I found it! Consider this some free publicity for [https://github.com/JeffreySarnoff/NamedTupleTools.jl](https://github.com/JeffreySarnoff/NamedTupleTools.jl)
