Instead of using the existing R7RS (case-lambda) macro (case-lambda) should become a primitive expression that explicitly tracks the signature of each case. This provides a number of benefits:
1) The sanity of the (case-lambda)'s arities can be checked at declaration time with useful diagnostics
2) The arity of (case-lambda)applications can be validated at compile time
3) (case-lambda:) with type feedback can be implemented using the existing typed lambda infrastructure
4) Code generation and closure handling could be improved, particularly with mutable pairs
Instead of using the existing R7RS (case-lambda) macro (case-lambda) should become a primitive expression that explicitly tracks the signature of each case. This provides a number of benefits:
1) The sanity of the (case-lambda)'s arities can be checked at declaration time with useful diagnostics
2) The arity of (case-lambda)applications can be validated at compile time
3) (case-lambda:) with type feedback can be implemented using the existing typed lambda infrastructure
4) Code generation and closure handling could be improved, particularly with mutable pairs