ANSWER TO EXERCISE 64 | |
Global c_warned = false; Class Cherub with parse_name [ i j flag; for (flag=true:flag:flag=false) { j=NextWord(); if (j=='cherub' or j==self.name) flag=true; if (j=='cherubs' && (~~c_warned)) { c_warned=true; parser_action=##PluralFound; flag=true; print "(I'll let this go once, but the plural of cherub is cherubim.)^"; } if (j=='cherubim') { parser_action=##PluralFound; flag=true; } i++; } return i-1; ];Then again, Shakespeare even wrote "cherubins'' in 'Twelfth Night', so who are we to censure? |