https://github.com/harryscholes/autoaccessormethods.jl
Automatically define accessor methods for fields of a type
https://github.com/harryscholes/autoaccessormethods.jl
Last synced: 2 months ago
JSON representation
Automatically define accessor methods for fields of a type
- Host: GitHub
- URL: https://github.com/harryscholes/autoaccessormethods.jl
- Owner: harryscholes
- License: mit
- Created: 2020-07-06T19:40:24.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2020-07-14T14:26:44.000Z (almost 5 years ago)
- Last Synced: 2025-02-05T10:49:30.724Z (4 months ago)
- Language: Julia
- Size: 7.81 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# AutoAccessorMethods
[](https://travis-ci.com/harryscholes/AutoAccessorMethods.jl)
[](https://codecov.io/gh/harryscholes/AutoAccessorMethods.jl)Automatically define accessor methods for fields of a type.
`@auto_accessor_methods` transforms the following code:
```julia
@auto_accessor_methods struct T
x
y
end
```into:
```julia
export x, ystruct T
x
y
endx(obj::T) = obj.x
y(obj::T) = obj.y
```This package is inspired by [AutoHashEquals.jl](https://github.com/andrewcooke/AutoHashEquals.jl).