A set of routines for parsing keyword option lists.
A keyword option list is a true list, each element of which is either a keyword, or a true list whose car is a keyword. Here is an example:
(:READ-ONLY (:PREFIX "Foo") (:DO-NOT :TAG :NORMALIZE))
The GET-OPTION routines provide an easy to use interface that in can handle a lot of the parsing and syntax checking for keyword option lists. Some routines exist in 2 forms: The first form, e.g.,
(GET-OPTION-AS-FLAG ctx option option-list)
takes a context (a name printed in case of an error), an option keyword, an option list, (possible other args as well) and looks for the option in the list. The function will abort if any syntax errors occur. The second form, e.g.,
(GET-OPTION-AS-FLAG-MV option option-list)
returns 2 values. The first value, if non-NIL, is an object produced by ACL2::MSG that describes the syntax error. The second value is the actual return value of the function. To avoid redundancy the -MV forms of the functions are not documnented.
To begin processing, use the function:
(GET-OPTION-CHECK-SYNTAX ctx option-list valid-options duplicate-options mutex-options)
(or GET-OPTION-CHECK-SYNTAX-MV) to check for basic option list syntax, and then use the various option list parsing functions listed above to get the values associated with the individual options.