M2
M2 copied to clipboard
Symbol as Optional Argument
For optional arguments that take in boolean values, currently you must type:
func(blah, Minimize => true)
but it would be nice if you could just type
func(blah, Minimize)
It carries the same information, can't be confused with a variable because optional argument symbols are protected symbols, and just looks nicer.
Probably the procedure that handles function closures with options needs to be modified to replace a standalone symbol Minimize with an option Minimize => true.
but what if the function requires a Symbol as a (non-optional) argument?
Are there functions that need options and symbols? It would be easy to change it so they accept a list of symbols instead, or there could be an option for method to disable this behavior.