Convert PATTERN from a macro to a pair of inline functions