# Understanding on MetaProgramming

**URL:** <https://discourse.julialang.org/t/understanding-on-metaprogramming/87223>\
**Category:** New to Julia\
**Created:** [September 13, 2022, 3:59pm UTC](https://discourse.julialang.org/t/understanding-on-metaprogramming/87223 "2022-09-13T15:59:11Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Brian1](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/brian1/32/49250_2.png) [@Brian1](https://discourse.julialang.org/u/Brian1)\
**Post date:** [September 13, 2022, 3:59pm UTC](https://discourse.julialang.org/t/understanding-on-metaprogramming/87223/1 "2022-09-13T15:59:11Z")

</div>

I has had always been much difficulty on understaning MetaProgramming.  
Here is an example. I tried again and again to get to the target. These codes works fine. But I believe thers must be some more brief way to get to this. Where can I change the codes?

```julia
abstract type Soft end

macro base_info1(ticker,super_tp,tz)
    struct_name=Symbol(ticker,super_tp)
    const_name=Symbol(ticker,:er)
    show_name=String(ticker)
    return quote
        struct $struct_name <: $super_tp; end
        const $const_name=$struct_name()
        Base.show(io::IO,x::$struct_name)=print(io,$show_name)
        tick_size(::T) where {T<:$struct_name}=$tz
    end |> esc
end

@base_info1 AB Soft 1

ABSoft
#ABSoft

ABer
#AB

tick_size(ABer)
#1

```
