Currently it doesn't seem to be possible for an argument to appear more than once in a function, eg
new SQLFunctionTemplate(StandardBasicTypes.BOOLEAN, "((?1 & ?2) = ?2)")
causes errors because when the query is run it doesn't bind the second '?2' parameter.