[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: enum and named sets
[Thread Prev] | [Thread Next]
- Subject: Re: enum and named sets
- From: Brian G <brian@xxxxxxxxxxxxxxxx>
- Date: Mon, 8 Dec 2025 14:09:27 -0800
- To: user@xxxxxxxxxxxxxxxxxxxxxx
On 12/7/25 12:58, Benoît Minisini wrote:
Being that enums are constants, and may not change then, the usage and generation of the enum it's self need not change, the compiler need only generate an integer array, by the set name also read only. and public if indicated. Nothing about the actual enum values usage or definition need change at all. What do you think?Le 06/12/2025 à 21:03, Brian G a écrit :Would it be useful or possible to allow the naming of enum sets such that they could be referenced by that name collectively without having to generate a special class with just a public enum. This could be very useful I think.Or maybe there is already a simple way to do this! Such that enum this_set_name none,fast, slow,red,green this allowing things like dim setcounter[] as new integer[5] inc setcounter[none] inc setcounter[green] or for each xx as variant in this_set_name print setcounter[xx] nextI think this request already exists in the bug tracker.I don't know if it is possible to implement it in a way that does not hurt the interpreter speed.At the moment, enumeration symbols are just like constants: the interpreter does not have the information that they are all members of an enumeration, and does not know the name of that enumeration.Moreover, the enumerations symbols are just Integer at runtime. The enumeration is not a type by itself at all.I must think about it more. Regards,
-- ~~~~ Brian
Attachment:
OpenPGP_0x78BFB26402F48419.asc
Description: OpenPGP public key
Attachment:
OpenPGP_signature.asc
Description: OpenPGP digital signature
| Re: enum and named sets | Benoît Minisini <benoit.minisini@xxxxxxxxxxxxxxxx> |
| enum and named sets | Brian G <brian@xxxxxxxxxxxxxxxx> |
| Re: enum and named sets | Benoît Minisini <benoit.minisini@xxxxxxxxxxxxxxxx> |