# \[ANN\] StrucRev - revise type definitions as you go

**URL:** <https://discourse.julialang.org/t/ann-strucrev-revise-type-definitions-as-you-go/109959>\
**Category:** Package Announcements\
**Tags:** macros, revise, struct\
**Created:** [February 8, 2024, 10:52pm UTC](https://discourse.julialang.org/t/ann-strucrev-revise-type-definitions-as-you-go/109959 "2024-02-08T22:52:58Z")\
**Posts on this page:** 1\
**Showing post:** 18

<div class="post-metadata">

**Author:** ![Eben60](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/eben60/32/13475_2.png) [@Eben60](https://discourse.julialang.org/u/Eben60)\
**Post date:** [July 28, 2024, 3:06pm UTC](https://discourse.julialang.org/t/ann-strucrev-revise-type-definitions-as-you-go/109959/18 "2024-07-28T15:06:50Z")

</div>

In the meanwhile there may be a chance for a general solution [in sight](https://discourse.julialang.org/t/this-month-in-julia-world-2024-05/115278/1)

> [@This month in Julia world - 2024-05](https://discourse.julialang.org/t/this-month-in-julia-world-2024-05/115278/1):
>
> This might be changing soon (enabling Revise to redefine structs). See this [old proposal](https://github.com/JuliaLang/julia/issues/40399) and [recent (well documented) work on implementation](https://github.com/JuliaLang/julia/pull/54654).

and most probably the problem is above my competence anyway. Still, the following idea, rather vague one:

```julia
module Module_Foo
    struct Foo
        x::Int
    end
end
Foo = Module_Foo.Foo

# now we want to re-define Foo
fm = methodswith(Foo)

sources = [m.source_ref for m in fm] # pseudocode

# delete "old" methods
for m in fm
    Base.delete_method(m)
end

# re-define Foo
module Module_Foo
    struct Foo
        x::Int
        y::Int
    end
end
Foo = Module_Foo.Foo 

for s in sources
    recompile(s) # pseudocode
end

```

in separate place:

```julia
foo(a::Foo) = a.x

```

Any idea what to put on the place of the pseudocode?

---

_[View the full topic](https://discourse.julialang.org/t/ann-strucrev-revise-type-definitions-as-you-go/109959)._
