Re: Enums/flags as objects?
| From: | Andrei Zmievski | Date: | Tue, 10 Aug 2004 23:16:04 +0000 |
| Subject: | Re: Enums/flags as objects? | ||
| References: | 1 2 | Groups: | php.gtk.dev |
| Request: | Send a blank email to php-gtk-dev+get-705@lists.php.net to get a copy of this message | ||
On Tue, 10 Aug 2004, Christian Weiske wrote:
> I think it would be better to have the normal int types. For the
> backtracking, a class/function could be made which could be called when
> the programmer needs the name explicitly. The function returns the name
> to a given integer.
Eh, how the hell is it going to do that? An integer does not carry any
additional information with it.
> Additionally we'd need
> a) different functions for each enum type
> $enumresolv->getCursorName( 4);
That sucks. :)
> b) one function which accepts a "enum type group" as parameter
> getEnumName( 4, ENUM_CURSOR);
That sucks less, but still sucks. :)
The object way would be:
php: echo ENUM_CURSOR;
output: <enum CURSOR_ARROW of type CursorType>
- Andrei