2
$\begingroup$

Does there exist a single pattern that would match SubValues of arbitrary "length" with a given head? For example, I would like to match all of the following

f[x]
f[x][y]
f[x][y][z]
f[x][y][z][w]
...
$\endgroup$
3
  • $\begingroup$ This question has been asked before on Stack Overflow. I can't mark it as a duplicate because that's a separate site, but otherwise it is a duplicate. You can find solutions to your question there. $\endgroup$ Jul 12, 2020 at 16:14
  • $\begingroup$ Thanks, I'll close the question $\endgroup$
    – Hausdorff
    Jul 12, 2020 at 16:17
  • $\begingroup$ Please don't close it. Others with this question who come to this site, will see it and a reference to the other one. Thanks. $\endgroup$ Jul 12, 2020 at 16:17

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.