Defdelegate different arity?

Using defdelegate, is possible to alias a function with a different arity? For example I have function small/3 which is needing String.downcase

defdelegate small(text, _, _), to: String, as: :downcase

but this is not working. I only wish to call String.downcase with the first arg to small/3.

No, that cannot be done.

Just write it as def small(text, _, _), do: String.downcase(text), it is the same AFAIK.

Edit: looks like defdelegate pulls the docs too. More info: Is defdelegate necessary?

2 Likes