Kernel — Elixir v1.20.2 has an example similar to what you want:
defmodule A do
defmacro __using__(_opts) do
quote do
def foo, do: "Foo"
defoverridable [foo: 0]
end
end
end
defmodule B do
use A
def foo do
super() <> "Bar"
end
end
And then in the shell
iex(1)> B.foo()
"FooBar"






















