#how do i make functions with optional parameters without overloading

15 messages · Page 1 of 1 (latest)

indigo crow
#

I'm wondering if I can make functions have optional parameters without overloading, as it gets quite messy.

dire knollBOT
#

Hey, @indigo crow!
Please remember to /close this post once your question has been answered!

unreal echo
#

You don't

indigo crow
#

is it not poss

unreal echo
#

no

#

Atleast not if you are using language level parameters

#

You can also pass a map of key-value pairs and use map.getOrDefault()

indigo crow
#

oh i c

#

using hashtables?

high hull
#

Can also use a builder pattern

unreal echo
unreal echo
indigo crow
#

ah alr

#

tysm guys