private void validateName(String nam) {
    if(!Character.isLetter(nam.charAt(0))          ) { throw new IllegalArgumentException("Names for constants, variables and functions must start with a letter"     ); }
    if(nam.indexOf('(')!=-1 || nam.indexOf(')')!=-1) { throw new IllegalArgumentException("Names for constants, variables and functions may not contain a parenthesis"); }
    }