Skip to content

how to encode global exception id #74

@bobzhang

Description

@bobzhang

there are serveral built in exceptions

var Out_of_memory = [248, "Out_of_memory", 0];                                                                                                                                                                      
var Sys_error = [248, "Sys_error", -1];                                                                                                                                                                             var Failure = [248, "Failure", -2];                                                                                                                                                                                 
var Invalid_argument = [248, "Invalid_argument", -3];                                                                                                                                                               var End_of_file = [248, "End_of_file",-4];                                                                                                                                                                          
var Division_by_zero = [248, "Division_by_zero", -5];                                                                                                                                                               
var Not_found = [248, "Not_found", -6];                                                                                                                                                                             
var Match_failure = [248, "Match_failure", -7];                                                                                                                                                                     
var Stack_overflow = [248, "Stack_overflow",-8];                                                                                                                                                                    
var Sys_blocked_io = [248, "Sys_blocked_io", -9];                                                                                                                                                                   
var Assert_failure = [248, "Assert_failure", -10];                                                                                                                                                                  
var Undefined_recursive_module = [248, "Undefined_recursive_module", -11];     

These are specially handled by the type checker, do they really need encode it that way, how about

var Out_of_memory =  "Out_of_memory";                                                                                                                                                                      
var Sys_error = "Sys_error";                                                                                                                                                                             var Failure =  "Failure";                                                                                                                                                                                 
var Invalid_argument = "Invalid_argument";                                                                                                                                                               var End_of_file =  "End_of_file";                                                                                                                                                                          
var Division_by_zero = "Division_by_zero";                                                                                                                                                               
var Not_found = "Not_found";                                                                                                                                                                             
var Match_failure =  "Match_failure";                                                                                                                                                                     
var Stack_overflow = "Stack_overflow";                                                                                                                                                                    
var Sys_blocked_io =  "Sys_blocked_io";                                                                                                                                                                   
var Assert_failure =  "Assert_failure";                                                                                                                                                                  
var Undefined_recursive_module = "Undefined_recursive_module";     

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions