1
$\begingroup$

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

$\endgroup$
  • 1
    $\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 '19 at 21:20
  • 1
    $\begingroup$ I have discussed some forms of polymorphism here. Also related: How to create strong types?. $\endgroup$ – Leonid Shifrin Oct 20 '19 at 14:25