-
Notifications
You must be signed in to change notification settings - Fork 21
Closed
Description
The choice type determines if a string is in a list of possible choices (name from to the python optparse choice option). This would replace the current heavy usage of string with match(SELF, '^(a|b|c)$') with
"attr" ? choice('a', 'b', 'c')String as a basetype is the most common one (or even only one). makes no sense for boolean i think, and long already has long(1..4) which is something similar. so only float is not covered, which i think is acceptable.
Related to quattor/template-library-core#102
To be implemented via one of
- make a new type buitin that does this (we can use function to check type #95 in case someone wants the
choiceto be usabel via a functionfunction is_choice = {is_type(choice, ARGV);} - a new builtin
is_choiceand we can make a pantypetype choice = string[] with is_choice(SELF)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels