On Fri, Feb 20, 2015 at 3:28 AM, Keean Schupke <[email protected]> wrote: > Specialisation means to alter the function definition (as in C++ template > specialisation) or are we running across terminology differences?
That is the right kind of "specialization". > So when shap says function specialisation, to me that means changing the > function definition via AST rewrite (inserting or removing lambdas)/to > change the type. You could end up with multiple versions of the same > function definition taking different arities. The functions definitions that are changed are the functions with calls to arity-abstract functions. Function definitions themselves are never arity-abstract in Shap's scheme. It turns out no, you never mess with lambdas. You mess with applications to generate calls for the right arities. Specialization means there will be multiple low-level definitions of a function, but they will all have the same arity and only differ in how they call other functions. > If you ignore the optional alias, we have to know the concrete arity of > imported functions because we do not have access to the definitions to > specialise them. We have to declare the type to allow separate compilation > (and stable module interfaces). There are no optional aliases, and we know the arity of imported functions because importable functions are defined at the toplevel of some module, and thus have a known arity. _______________________________________________ bitc-dev mailing list [email protected] http://www.coyotos.org/mailman/listinfo/bitc-dev
