This is not possible in Ruby.
There are many options, though, depending on what you do with your advanced options, and what the method should do.
The obvious choice is
1) Take named parameters using hash syntax
def dothis params value = params[:value] || 0 list_of_stuff = params[:list] || []
Ruby has a nice calling convention around this, you donβt have to provide a hash {} of brackets
dothis :list => ["hey", "how are you", "good"]
2) Move the value to the end and take an array for the first parameter
def dothis list_of_stuff, value=0
Called as follows:
dothis ["hey", "how are you", "good"], 17
3) Use a code block to provide a list
dothis value = 0 list_of_stuff = yield
Called as
dothis { ["hey", "how are you", "good"] }
4) Ruby 2.0 introduced named hash parameters that handle many options 1, above for you:
def dothis value: 0, list: [] # Local variables value and list already defined # and defaulted if necessary
Called the same way as (1):
dothis :list => ["hey", "how are you", "good"]