https://github.com/federicostra/redefstructs.jl
Redefinable structures
https://github.com/federicostra/redefstructs.jl
code-reload julia metaprogramming redefine reload struct
Last synced: 3 months ago
JSON representation
Redefinable structures
- Host: GitHub
- URL: https://github.com/federicostra/redefstructs.jl
- Owner: FedericoStra
- License: mit
- Created: 2020-12-11T14:39:49.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2021-04-09T18:36:14.000Z (about 4 years ago)
- Last Synced: 2025-04-07T04:07:44.568Z (3 months ago)
- Topics: code-reload, julia, metaprogramming, redefine, reload, struct
- Language: Julia
- Homepage:
- Size: 123 KB
- Stars: 26
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# RedefStructs.jl

[](https://FedericoStra.github.io/RedefStructs.jl/stable)
[](https://FedericoStra.github.io/RedefStructs.jl/dev)
[](https://github.com/FedericoStra/RedefStructs.jl/actions)
[](https://github.com/invenia/BlueStyle)
[](https://github.com/SciML/ColPrac)This package provides the macro `@redef`, which allows to create `struct`ures which are redefinable.
## Example
```julia
julia> using RedefStructsjulia> @redef struct S
s::String
endjulia> S("Hello").s
"Hello"julia> @redef mutable struct S
n::Int
endjulia> S(42).n
42
```