1
$\begingroup$

Is there a way to have polymorphic function definitions in Mathematica? I looked around online and didn't anything discussing it.

$\endgroup$
2
  • 2
    $\begingroup$ possible with type checking len[x_?StringQ] := StringLength@x; len[x_?ListQ] := Length@x; len["greeks"] len[{10, 20, 30}] $\endgroup$
    – Xminer
    Oct 19, 2019 at 21:20
  • 1
    $\begingroup$ I have discussed some forms of polymorphism here. Also related: How to create strong types?. $\endgroup$ Oct 20, 2019 at 14:25

0

Browse other questions tagged or ask your own question.