When should a function accept a symbol as an argument?

Absolutely! I’m just trying to imagine use cases for symbols.

True, most users probably just take the syntax at face value and do not worry about it.

To really understand the call foo(:bar), one needs to understand what symbols and language objects are, and that functions can operate on them. The large number of votes for the symbol stack overflow question I originally linked to shows that many needed that thorough, lengthy explanation.

OTOH, maybe symbols are a good entry point for starting to learn about metaprogramming, so it’s good if people see them often and are comfortable with them.

1 Like