Changes between Version 17 and Version 18 of CompilerDesignNotes

Show
Ignore:
Timestamp:
09/16/09 13:53:50 (2 months ago)
Author:
dr2chase
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • CompilerDesignNotes

    v17 v18  
    5151where ''API'' is the api name, ''name'' is the top-level function or opr name, and ''type'' is the fortress type of the closure (an arrow type, Arrow⟦''domain'',''range''⟧).  Ond-demand generation is used to cut down on the creation of unused classes (each closure results in a class).  For generic functions, each instantiated top-level generic function will result in a class, so it might as well do double-duty as a closure. 
    5252 
     53''Question: is it really API.whatever, or is it API$whatever (i.e., subpackage, or inner class)?'' 
     54 
    5355The proposed encoding of a generic function is a class named 
    5456   ''API'' "." mangle("⚙" ''name'' ''parameters'' "✉" ''type'') 
     
    7274 * because an overloaded function may have the same signature as one of the functions that it overloads, there has to be a way to mangle one of the names out of the way; 
    7375 * because an overloaded implementation is not necessarily evident at the API level (the type of the overloaded function could be a simple Fortress type), (exported) overloaded functions within components; 
    74  * overload dispatch can occur twice; once within the component, and again within the API (and if the chosen overloaded function happens to be a functional method, one more time after that). 
     76 * overload dispatch can occur twice; once within the component, and again within the API (and if the chosen overloaded function happens to be a functional method, one more time after that).  Flattening it into a single dispatch is not trivial; because component-level overloadings behind the API may not be visible, it is possible that a naively combined overloading would not satisfy the meet rule; that is, there would be ambiguities, and dispatch order would matter. 
    7577 
    7678ASIF dispatching is an interesting special case.  It separates into several simpler cases: