Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/federicostra/redefstructs.jl
Redefinable structures
https://github.com/federicostra/redefstructs.jl
code-reload julia metaprogramming redefine reload struct
Last synced: 2 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 (about 4 years ago)
- Default Branch: master
- Last Pushed: 2021-04-09T18:36:14.000Z (almost 4 years ago)
- Last Synced: 2024-11-08T23:06:09.230Z (3 months ago)
- Topics: code-reload, julia, metaprogramming, redefine, reload, struct
- Language: Julia
- Homepage:
- Size: 123 KB
- Stars: 26
- Watchers: 2
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# RedefStructs.jl
![Lifecycle](https://img.shields.io/badge/lifecycle-experimental-orange.svg)
[![Stable](https://img.shields.io/badge/docs-stable-blue.svg)](https://FedericoStra.github.io/RedefStructs.jl/stable)
[![Dev](https://img.shields.io/badge/docs-dev-blue.svg)](https://FedericoStra.github.io/RedefStructs.jl/dev)
[![Build Status](https://github.com/FedericoStra/RedefStructs.jl/workflows/CI/badge.svg)](https://github.com/FedericoStra/RedefStructs.jl/actions)
[![Code Style: Blue](https://img.shields.io/badge/code%20style-blue-4495d1.svg)](https://github.com/invenia/BlueStyle)
[![ColPrac: Contributor's Guide on Collaborative Practices for Community Packages](https://img.shields.io/badge/ColPrac-Contributor's%20Guide-blueviolet)](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
```