Polymorphic function definitionsλ︎
Polymorphic means many forms.
The simplest example of polymorphism in Clojure is a function definition that acts differently based on the number of arguments passed.
Usually you define a function with one set of arguments, either none
[one] or many
[any number of args], using the basic syntax
Instead of writing multiple functions with the same name that each take different numbers of arguments, you can use the following polymorphic syntax in Clojure
Note Write a simple function called
i-am-pollythat returns a default message when given no arguments and a custom message when given a custom string as an argument