[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: Benoît Minisini <benoit.minisini@xxxxxxxxxxxxxxxx>
- Date: Sun, 7 Dec 2025 21:58:47 +0100
- To: user@xxxxxxxxxxxxxxxxxxxxxx
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] next
I 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, -- Benoît Minisini.
| Re: enum and named sets | Fabien Bodard <gambas.fr@xxxxxxxxx> |
| Re: enum and named sets | Brian G <brian@xxxxxxxxxxxxxxxx> |
| enum and named sets | Brian G <brian@xxxxxxxxxxxxxxxx> |