enum hyphen

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

enum hyphen

tong-2
hi,

would it be possible to allow '-' characters in enum constructors ?

The XMPP standard, for example, specifies some xml attributes like
'jid_single', which i want to reflect to and from ENums.

Currently i have to hack it like:
var str : String =
~/_/.replace( Type.enumConstructor( MyEnum.jid_single ), "-" );

.. which isnt such a beauty.


.tong

--
[)   |   5   |<   †   |2   3   3


--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: enum hyphen

Nicolas Cannasse
tong a écrit :

> hi,
>
> would it be possible to allow '-' characters in enum constructors ?
>
> The XMPP standard, for example, specifies some xml attributes like
> 'jid_single', which i want to reflect to and from ENums.
>
> Currently i have to hack it like:
> var str : String =
> ~/_/.replace( Type.enumConstructor( MyEnum.jid_single ), "-" );

It would be a bit troublesome, because when generating code, we would
have to replace - by _, and there might be conflicts.

Also, it might be confusing for parsing numerical operations such as A-B

So the answer is : no ;)

Nicolas

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: enum hyphen

tong-2
On Sun, 2008-11-23 at 17:09 +0100, Nicolas Cannasse wrote:

> tong a écrit :
> > hi,
> >
> > would it be possible to allow '-' characters in enum constructors ?
> >
> > The XMPP standard, for example, specifies some xml attributes like
> > 'jid_single', which i want to reflect to and from ENums.
> >
> > Currently i have to hack it like:
> > var str : String =
> > ~/_/.replace( Type.enumConstructor( MyEnum.jid_single ), "-" );
>
> It would be a bit troublesome, because when generating code, we would
> have to replace - by _, and there might be conflicts.
>
> Also, it might be confusing for parsing numerical operations such as A-B
>
> So the answer is : no ;)

ici, no prob, thanks.

.tong

--
[)   |   5   |<   †   |2   3   3


--
haXe - an open source web programming language
http://haxe.org