factoring out parameter list checks in lambda, so we can reuse for macros