Hi Jim! Le 23 sept. 2012 à 16:19, Jim Meyering a écrit :
>> # member-check VARIABLE,VALID-VALUES >> member-check = \ >> $(if $($(1)), \ >> $(if $(findstring $(_sp),$($(1))), \ >> $(error invalid $(1): '$($(1))', expected $(2)), \ >> $(or $(findstring $(_sp)$($(1))$(_sp),$(_sp)$(2)(_sp)), \ >> $(error invalid $(1): '$($(1))', expected $(2)))), \ >> $(error $(1) undefined)) >> >> $(call member-check,RELEASE_TYPE,$(RELEASE_TYPES)) > > I like the function. > For this application, where no valid value contains a space, your use of > SPACE as a delimiter is fine. However, in general you might want to use > a byte that is less likely to be included in one of the expected values. Sure, but then the list of values must also be provided with the expected separator. Do you want a generalized form right now, or shall we wait for some use case before?