Why do people use _? as an identifier suffix?
问题 I start reading Lift framework source code, I find that there're so many methods are defined using a name like methodName_? , is there a convention that _? has some special meaning? def empty_? : Boolean = {} 回答1: The ? denotes that this is a predicate, a function returning Boolean . This convention goes back to Lisp, where ? (Scheme), p or -p (other Lisps, simulating the question mark with a "similar" letter) also denote predicates. Think of it as asking a question, "is the object empty?"