Skip to content

Commit

Permalink
Use Macro.generate_arguments/2
Browse files Browse the repository at this point in the history
  • Loading branch information
edgurgel committed Aug 17, 2024
1 parent 55ebadd commit 7316c12
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions lib/mimic/module.ex
Original file line number Diff line number Diff line change
Expand Up @@ -141,11 +141,7 @@ defmodule Mimic.Module do

for {fn_name, arity} <- module.module_info(:exports),
{fn_name, arity} not in internal_functions do
args =
0..arity
|> Enum.to_list()
|> tl()
|> Enum.map(&Macro.var(String.to_atom("arg_#{&1}"), Elixir))
args = Macro.generate_arguments(arity, module)

quote do
def unquote(fn_name)(unquote_splicing(args)) do
Expand Down

0 comments on commit 7316c12

Please sign in to comment.