View Issue Details [ Jump to Notes ] | [ Issue History ] [ Print ] | ||||||||||||
ID | Project | Category | View Status | Date Submitted | Last Update | ||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0000577 | mercury | Feature Request | public | 2025-08-13 03:27 | 2025-08-13 03:27 | ||||||||
Reporter | zs | ||||||||||||
Assigned To | |||||||||||||
Priority | normal | Severity | minor | Reproducibility | have not tried | ||||||||
Status | new | Resolution | open | ||||||||||
Product Version | |||||||||||||
Target Version | Fixed in Version | ||||||||||||
Summary | 0000577: composite enums | ||||||||||||
Description | Types such as the ext type in the compiler, which have - several function symbols, - all of which one argument, - and all those arguments have types that are effectively enums, should be themselves represented as one large enum. Given e.g. :- type t ---> f(t1) ; g(t2). where t1 is an enum with values 0-12 and t2 is an enum with values 0-42, then t should be such a "composite enum" with values 0-55, with values 0-12 corresponding to function symbol f, and values 13-55 corresponding to g (with the value of g's argument being t's value minus 13. The natural way to do switches on such composite enums would be by binary search, not on the raw values, but on the dividing lines between the integer ranges assigned to the function symbols. Each binary step would rule out half (rounded down) of the remaining possible function symbols. | ||||||||||||
Tags | No tags attached. | ||||||||||||
Attached Files |
|
![]() |
|||
Date Modified | Username | Field | Change |
---|---|---|---|
2025-08-13 03:27 | zs | New Issue |