# How to make a function ignore an argument

## Motivation

I am trying to call a function `f`, that has either 1 or 2 (or multiple) parameters, from a function `g` that uses optional arguments

``````Clear(f, g)

f(x_) := "foo"
f(x_, y_) := {x, y}

Options(g) = {"y" -> 5};
g(m_, OptionsPattern()) := f(3*m, OptionValue("y"))

g(2) (* {6,5} *)
g(2, "y" -> -6) (* {6,-6}*)
``````

I want be able call `f` with 1 parameter from `g` to get

``````g(2, "y"->someMagicMethod) = "foo"
``````

I have tried

``````g(2, "y" -> Blank()) (* {6,_} *)
g(2, "y" -> Nothing) (* {6} *)
g(2, "y" -> None) (* {6,None} *)
g(2, "y" -> Null) (* {6,Null} *)
g(2, "y" -> Identity) (* {6,Identity} *)
``````

## Possible Solution

An idea is to place the arguments into a list and take advantage of the fact that `Nothing` disappears when in a list and then using `Apply`

``````Options(g2) = {"y" -> 5};
g2(m_, OptionsPattern()) := f@@{3*m, OptionValue("y")}; (* arguments in a list *)

g2(6, "y" -> Nothing) (* "foo" *)
``````

I’m not sure that this is the best method as you need to ensure that the list is ordered correctly before applying `f`.

Is there a more general solution that scales well with `f` or `g` increasing in complexity of arguments / optional values?

Am I missing a better “Option” way to set up `g` using `FilterRules` etc. or patterns ?