3
$\begingroup$

Given a list of symbols, say {y[x],z[x],k}

Is there a way to sort which depend on x and which don't ? Applied to the above list, the method would give:

{y[x],z[x]}

and {k}

Thanks in advance

$\endgroup$
6
  • 2
    $\begingroup$ Have you seen FreeQ[]? $\endgroup$ Jan 30, 2017 at 7:29
  • $\begingroup$ Consider also GatherBy[]. $\endgroup$
    – Kiro
    Jan 30, 2017 at 7:32
  • $\begingroup$ I guess FreeQ[#, x] & /@{y[x], k, x} could be enough for what I have in mind. Although, is there a way to explicitly check for [x]'s presence and rather than x ? $\endgroup$
    – jrekier
    Jan 30, 2017 at 7:33
  • 2
    $\begingroup$ @jrekier _[x]. $\endgroup$
    – Kuba
    Jan 30, 2017 at 7:43
  • 1
    $\begingroup$ @Kuba Will this pick f[x,z] also? It gets tricky? Function that depends on x and other variables? $\endgroup$
    – Nasser
    Jan 30, 2017 at 7:46

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.