https://github.com/tpapp/eponymtuples.jl
Julia package for deconstructing dispatch on NamedTuples.
https://github.com/tpapp/eponymtuples.jl
julia julia-language macros
Last synced: 3 months ago
JSON representation
Julia package for deconstructing dispatch on NamedTuples.
- Host: GitHub
- URL: https://github.com/tpapp/eponymtuples.jl
- Owner: tpapp
- License: other
- Created: 2018-09-02T11:13:24.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2020-12-20T09:14:49.000Z (over 5 years ago)
- Last Synced: 2025-08-24T00:42:34.782Z (10 months ago)
- Topics: julia, julia-language, macros
- Language: Julia
- Size: 11.7 KB
- Stars: 12
- Watchers: 2
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# EponymTuples

[](https://travis-ci.org/tpapp/EponymTuples.jl)
[](https://coveralls.io/github/tpapp/EponymTuples.jl?branch=master)
[](http://codecov.io/github/tpapp/EponymTuples.jl?branch=master)
Julia package for deconstructing dispatch on `NamedTuple`s.
Uses the variable names *both* for the `NamedTuple` and deconstruction.
Allows replacing
```julia
f((a, b)::NamedTuple{(:a, :b), <: Tuple{Any, Int}}) = ...
(a = a, b = b, c = 3)
```
with
```julia
f(@eponymargs(a, b::Int)) = ...
@eponymtuple(a, b, c = 3)
```
It is pretty lightweight: `@eponymargs` and `@eponymtuple` are the only symbols exported; and the package has no dependencies.
The package is registered, install with
```julia
pkg> add EponymTuples
```