A variant of UserIO.getInput that'll constantly prompt the user until they enter a value from the given list.
Behaviour:
All items of list are converted to a string (via std.conv.to), and the user must enter the *exact* value of one of these
strings for this function to return, so if you're wanting to use a struct then ensure you make toString provide a user-friendly
value.
This function does not use Binder to provide the final value, it will instead simply return the appropriate
item from list. This is because the value already exists (inside of list) so there's no reason to perform a conversion.
The Binder is only used to convert the user's input from a string into another string, in case there's any transformations
you'd like to perform on it.
Prompt:
The prompt layout for this variant is a bit different than other variants.
A variant of UserIO.getInput that'll constantly prompt the user until they enter a value from the given list.
Behaviour: All items of list are converted to a string (via std.conv.to), and the user must enter the *exact* value of one of these strings for this function to return, so if you're wanting to use a struct then ensure you make toString provide a user-friendly value.
This function does not use Binder to provide the final value, it will instead simply return the appropriate item from list. This is because the value already exists (inside of list) so there's no reason to perform a conversion.
The Binder is only used to convert the user's input from a string into another string, in case there's any transformations you'd like to perform on it.
Prompt: The prompt layout for this variant is a bit different than other variants.
$prompt[$list[0], $list[1], ...]$promptPostfix
For example Choose colour[red, blue, green]: